X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg.c;h=49e559679299e43bd28b0f00c1302398b33f3570;hb=451469fd1aa141b15baea06a66e2404721de1e0b;hp=d5e9afa8b76dfe3241a80806726b62bba40a7be6;hpb=a083543da03e9270c1677eca592e96a298cccb1d;p=ffmpeg diff --git a/ffmpeg.c b/ffmpeg.c index d5e9afa8b76..49e55967929 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1127,6 +1127,19 @@ static void do_video_stats(OutputStream *ost, int frame_size) } } +static void finish_output_stream(OutputStream *ost) +{ + OutputFile *of = output_files[ost->file_index]; + int i; + + ost->finished = ENCODER_FINISHED | MUXER_FINISHED; + + if (of->shortest) { + for (i = 0; i < of->ctx->nb_streams; i++) + output_streams[of->ost_index + i]->finished = ENCODER_FINISHED | MUXER_FINISHED; + } +} + /** * Get and encode new output from any of the filtergraphs, without causing * activity. @@ -3315,7 +3328,7 @@ static int process_input(int file_index) if (ost->source_index == ifile->ist_index + i && (ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE)) - close_output_stream(ost); + finish_output_stream(ost); } }