]> git.sesse.net Git - ffmpeg/commitdiff
lavf/mpegenc: provide better feedback in case of invalid media type
authorStefano Sabatini <stefasab@gmail.com>
Thu, 27 Aug 2015 15:41:52 +0000 (17:41 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Thu, 27 Aug 2015 16:07:43 +0000 (18:07 +0200)
libavformat/mpegenc.c

index 2520f49db194c159058249fc44556927cba8bce4..b3ee2a09b9decac9bbfb63cfa8ce88db09a7001c 100644 (file)
@@ -410,7 +410,9 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
             stream->max_buffer_size = 16 * 1024;
             break;
         default:
-            return -1;
+            av_log(ctx, AV_LOG_ERROR, "Invalid media type %s for output stream #%d\n",
+                   av_get_media_type_string(st->codec->codec_type), i);
+            return AVERROR(EINVAL);
         }
         stream->fifo = av_fifo_alloc(16);
         if (!stream->fifo)