--- fftools/ffmpeg.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index da4259a9a8..fa54421d73 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3869,12 +3869,14 @@ static int need_output(void) */ static OutputStream *choose_output(void) { - int i; + int i,_i; + static int last_i; int64_t opts_min = INT64_MAX; OutputStream *ost_min = NULL; for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; + _i = (last_i + 1 + i) %nb_output_streams; + OutputStream *ost = output_streams[_i]; int64_t opts = ost->st->cur_dts == AV_NOPTS_VALUE ? INT64_MIN : av_rescale_q(ost->st->cur_dts, ost->st->time_base, AV_TIME_BASE_Q); @@ -3889,6 +3891,8 @@ static OutputStream *choose_output(void) ost_min = ost->unavailable ? NULL : ost; } } + if (ost_min) + last_i = ost_min->file_index; return ost_min; } -- 2.14.1.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel