summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-10-17 23:46:09 +0200
committerMarton Balint <cus@passwd.hu>2015-10-22 19:03:01 +0200
commitddc6bd8c95868b14aec385b2e7bb519559583042 (patch)
tree3356e7f8ecdffb2515d539cc57418a2e1d907fc4 /ffmpeg.c
parent5821244b225b34dbabcd5bf6cf1c0a9dc3e529dc (diff)
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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 5e9a12741e..a19c81667b 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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 */