Prevent seeking past end of stream, which causes a huge # of Seeks once EOF is reached, if we try and request frame #s too large for the file

This commit is contained in:
Jonathan Thomas
2022-11-23 12:45:10 -06:00
parent 5aa9487e05
commit 70db06947d
2 changed files with 5 additions and 1 deletions

View File

@@ -1773,6 +1773,10 @@ void FFmpegReader::Seek(int64_t requested_frame) {
requested_frame = 1;
if (requested_frame > info.video_length)
requested_frame = info.video_length;
if (requested_frame > largest_frame_processed && packet_status.end_of_file) {
// Not possible to search past largest_frame once EOF is reached (no more packets)
return;
}
// Debug output
ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::Seek",