summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2018-12-29 16:17:05 +0530
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-02 22:29:11 +0100
commit54109b1d1472bc49cec5e236508dffc96aa4f0a1 (patch)
tree4d75ac2b0ddb7e3233a8c046db96a43c2f804f90 /fftools/ffmpeg_filter.c
parent8f585c3c550c2dd7b2a3575f3544a3bede28eb9f (diff)
ffmpeg: skip disabled streams
Fully discarded streams can't be selected for output or mapped or filtered. Previously, a few packets from such streams, probably buffered for stream probing, would get smuggled into output files. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6518d50870..8c0ff99dd9 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -293,10 +293,17 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
exit_program(1);
}
ist = input_streams[input_files[file_idx]->ist_index + st->index];
+ if (ist->user_set_discard == AVDISCARD_ALL) {
+ av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
+ "matches a disabled input stream.\n", p, fg->graph_desc);
+ exit_program(1);
+ }
} else {
/* find the first unused stream of corresponding type */
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
+ if (ist->user_set_discard == AVDISCARD_ALL)
+ continue;
if (ist->dec_ctx->codec_type == type && ist->discard)
break;
}