More tweaks to the seeking code, to increase stability while seeking.

This commit is contained in:
Jonathan Thomas
2014-09-13 18:05:15 -05:00
parent 7eb25b54fc
commit f6b9ba4fa3
2 changed files with 10 additions and 16 deletions

View File

@@ -701,8 +701,6 @@ bool FFmpegReader::CheckSeek(bool is_video)
is_seeking = false;
seeking_frame = 0;
seeking_pts = -1;
//seek_audio_frame_found = 0; // used to detect which frames to throw away after a seek
//seek_video_frame_found = 0; // used to detect which frames to throw away after a seek
}
}
@@ -1380,8 +1378,8 @@ bool FFmpegReader::IsPartialFrame(int requested_frame) {
int max_seeked_frame = seek_audio_frame_found; // determine max seeked frame
if (seek_video_frame_found > max_seeked_frame)
max_seeked_frame = seek_video_frame_found;
if ((info.has_audio && seek_audio_frame_found && max_seeked_frame >= requested_frame) ||
(info.has_video && seek_video_frame_found && max_seeked_frame >= requested_frame))
if ((info.has_audio && seek_audio_frame_found && max_seeked_frame > requested_frame) ||
(info.has_video && seek_video_frame_found && max_seeked_frame > requested_frame))
seek_trash = true;
return seek_trash;