[FFmpeg-cvslog] lavf/mpegenc: provide better feedback in case of invalid media type

Stefano Sabatini git at videolan.org
Thu Aug 27 18:27:44 CEST 2015


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Aug 27 17:41:52 2015 +0200| [57cd2f7777a316a447301a7d4b5d1c01da200661] | committer: Stefano Sabatini

lavf/mpegenc: provide better feedback in case of invalid media type

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

 libavformat/mpegenc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 2520f49..b3ee2a0 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -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)



More information about the ffmpeg-cvslog mailing list