Removed some unneeded methods, due to the previous refactor involving shared_ptr objects. They no longer require some special overloads which "delete" the objects in the cache.

This commit is contained in:
Jonathan Thomas
2012-10-14 21:09:22 -05:00
parent 617088cebf
commit 48bef6b566
7 changed files with 15 additions and 52 deletions

View File

@@ -138,12 +138,6 @@ void FFmpegReader::Open() throw(InvalidFile, NoStreamsFound, InvalidCodec)
}
void FFmpegReader::Close()
{
// Close reader and clear cache
Close(true);
}
void FFmpegReader::Close(bool clear_cache)
{
// Close all objects, if reader is 'open'
if (is_open)
@@ -163,11 +157,8 @@ void FFmpegReader::Close(bool clear_cache)
avcodec_close(aCodecCtx);
}
// Clear final cache (based on the parameter)
if (clear_cache)
final_cache.Clear();
// Always clear temp cache
// Clear final cache
final_cache.Clear();
working_cache.Clear();
// Close the video file
@@ -336,7 +327,7 @@ tr1::shared_ptr<Frame> FFmpegReader::GetFrame(int requested_frame) throw(ReaderC
else if (!enable_seek && diff < 0)
{
// Start over, since we can't seek, and the requested frame is smaller than our position
Close(false);
Close();
Open();
}
@@ -899,7 +890,7 @@ void FFmpegReader::Seek(int requested_frame) throw(TooManySeeks)
if (requested_frame - buffer_amount <= 1)
{
// Close and re-open file (basically seeking to frame 1)
Close(false); // do not clear cache
Close();
Open();
// Not actually seeking, so clear these flags
@@ -1146,7 +1137,7 @@ void FFmpegReader::CheckWorkingFrames(bool end_of_stream)
final_cache.Add(f->number, f);
// Remove frame from working cache
working_cache.Remove(f->number, false);
working_cache.Remove(f->number);
// Update last frame processed
last_frame = f->number;