aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2014-07-18 10:34:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-05 04:13:38 +0200
commitf7b147548e768aa36acec9f752fcbd001d9e03c5 (patch)
tree9b253fd624f61a9a10f4735952e66f41d1a96d7c
parentf99b17bd32ca4048eff814655746d992cd580ce9 (diff)
downloadffmpeg-f7b147548e768aa36acec9f752fcbd001d9e03c5.tar.gz
ffmpeg_filter: refuse to configure input without a decoder.
The decoder is necessary in order to filter frames. This makes the error message clearer in this case: currently, it will usually fail because the pixel or sample format is not defined and is converted into "(null)" (non-portable). Enhance trac ticket #3779. (cherry picked from commit 91244073fd8b983e7cd1f97da83daf956fbbddc6) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffmpeg_filter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 582c66183d..f25ee8636f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -828,6 +828,12 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
av_freep(&ifilter->name);
DESCRIBE_FILTER_LINK(ifilter, in, 1);
+ if (!ifilter->ist->dec) {
+ av_log(NULL, AV_LOG_ERROR,
+ "No decoder for stream #%d:%d, filtering impossible\n",
+ ifilter->ist->file_index, ifilter->ist->st->index);
+ return AVERROR_DECODER_NOT_FOUND;
+ }
switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);