[FFmpeg-cvslog] Report "unknown codec" instead of "unspecifed size" if the codec is unknown.

Carl Eugen Hoyos git at videolan.org
Mon Jun 2 12:20:26 CEST 2014


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Jun  1 19:40:56 2014 +0200| [f284e85714527dceb0876c0dee39cc7a3228bed9] | committer: Carl Eugen Hoyos

Report "unknown codec" instead of "unspecifed size" if the codec is unknown.

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

 libavformat/utils.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1f72241..6df426b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2644,6 +2644,9 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
         return 0;                                                 \
     } while (0)
 
+    if (   avctx->codec_id == AV_CODEC_ID_NONE
+        && avctx->codec_type != AVMEDIA_TYPE_DATA)
+        FAIL("unknown codec");
     switch (avctx->codec_type) {
     case AVMEDIA_TYPE_AUDIO:
         if (!avctx->frame_size && determinable_frame_size(avctx))
@@ -2675,8 +2678,6 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
         if (avctx->codec_id == AV_CODEC_ID_NONE) return 1;
     }
 
-    if (avctx->codec_id == AV_CODEC_ID_NONE)
-        FAIL("unknown codec");
     return 1;
 }
 



More information about the ffmpeg-cvslog mailing list