diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-08-11 11:50:32 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-08-18 08:48:30 +0200 |
commit | 3c0df9058438b68925be2fc6f5af2a05086ad99e (patch) | |
tree | bc1a2ace6271700af353e68bf7519ff2b852e1b1 /avconv.c | |
parent | 91e59fea30f57af7abd1ad6a68a8f6663805ee44 (diff) | |
download | ffmpeg-3c0df9058438b68925be2fc6f5af2a05086ad99e.tar.gz |
avconv: make -shortest a per-output file option.
Diffstat (limited to 'avconv.c')
-rw-r--r-- | avconv.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -719,7 +719,7 @@ static int poll_filter(OutputStream *ost) */ static int poll_filters(void) { - int i, ret = 0; + int i, j, ret = 0; while (ret >= 0 && !received_sigterm) { OutputStream *ost = NULL; @@ -746,10 +746,14 @@ static int poll_filters(void) ret = poll_filter(ost); if (ret == AVERROR_EOF) { + OutputFile *of = output_files[ost->file_index]; + ost->finished = 1; - if (opt_shortest) - return ret; + if (of->shortest) { + for (j = 0; j < of->ctx->nb_streams; j++) + output_streams[of->ost_index + j]->finished = 1; + } ret = 0; } else if (ret == AVERROR(EAGAIN)) @@ -2170,10 +2174,7 @@ static int process_input(void) } } - if (opt_shortest) - return AVERROR_EOF; - else - return AVERROR(EAGAIN); + return AVERROR(EAGAIN); } reset_eagain(); |