mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 03:20:00 +01:00
fftools/ffmpeg: stop handling max_frames in do_video_out()
Frame limiting is now handled using sync queues. This code prevents the sync queue from triggering EOF, resulting in unnecessarily many frames being decoded, filtered, and then discarded. Found-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
@@ -1206,14 +1206,6 @@ static void do_video_out(OutputFile *of,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* For video, number of frames in == number of packets out.
|
|
||||||
* But there may be reordering, so we can't throw away frames on encoder
|
|
||||||
* flush, we need to limit them here, before they go into encoder.
|
|
||||||
*/
|
|
||||||
nb_frames = FFMIN(nb_frames, ost->max_frames - ost->vsync_frame_number);
|
|
||||||
nb0_frames = FFMIN(nb0_frames, nb_frames);
|
|
||||||
|
|
||||||
memmove(ost->last_nb0_frames + 1,
|
memmove(ost->last_nb0_frames + 1,
|
||||||
ost->last_nb0_frames,
|
ost->last_nb0_frames,
|
||||||
sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1));
|
sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1));
|
||||||
@@ -1262,7 +1254,9 @@ static void do_video_out(OutputFile *of,
|
|||||||
in_picture->pict_type = forced_kf_apply(ost, in_picture, i);
|
in_picture->pict_type = forced_kf_apply(ost, in_picture, i);
|
||||||
|
|
||||||
ret = submit_encode_frame(of, ost, in_picture);
|
ret = submit_encode_frame(of, ost, in_picture);
|
||||||
if (ret < 0 && ret != AVERROR_EOF)
|
if (ret == AVERROR_EOF)
|
||||||
|
break;
|
||||||
|
else if (ret < 0)
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
|
|
||||||
ost->next_pts++;
|
ost->next_pts++;
|
||||||
|
|||||||
Reference in New Issue
Block a user