diff options
author | Marton Balint <cus@passwd.hu> | 2015-10-17 23:46:09 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2015-10-22 19:03:01 +0200 |
commit | ddc6bd8c95868b14aec385b2e7bb519559583042 (patch) | |
tree | 3356e7f8ecdffb2515d539cc57418a2e1d907fc4 /ffmpeg.c | |
parent | 5821244b225b34dbabcd5bf6cf1c0a9dc3e529dc (diff) | |
download | ffmpeg-ddc6bd8c95868b14aec385b2e7bb519559583042.tar.gz |
ffmpeg: add abort_on option to allow aborting on empty output
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4054,6 +4054,7 @@ static int transcode(void) OutputStream *ost; InputStream *ist; int64_t timer_start; + int64_t total_packets_written = 0; ret = transcode_init(); if (ret < 0) @@ -4134,6 +4135,12 @@ static int transcode(void) if (ost->encoding_needed) { av_freep(&ost->enc_ctx->stats_in); } + total_packets_written += ost->packets_written; + } + + if (!total_packets_written && (abort_on_flags & ABORT_ON_FLAG_EMPTY_OUTPUT)) { + av_log(NULL, AV_LOG_FATAL, "Empty output\n"); + exit_program(1); } /* close each decoder */ |