[FFmpeg-cvslog] ffmpeg_filter: refuse to configure input without a decoder.

Nicolas George git at videolan.org
Wed Jul 30 15:44:48 CEST 2014


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Fri Jul 18 10:34:39 2014 +0200| [91244073fd8b983e7cd1f97da83daf956fbbddc6] | committer: Nicolas George

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91244073fd8b983e7cd1f97da83daf956fbbddc6
---

 ffmpeg_filter.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 50ee422..b6dc42f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -830,6 +830,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);



More information about the ffmpeg-cvslog mailing list