]> git.sesse.net Git - ffmpeg/commitdiff
Match the behaviour betwen the bmp and wav codec tag lookups
authorDavid Conrad <lessen42@gmail.com>
Wed, 5 Sep 2007 00:25:54 +0000 (00:25 +0000)
committerDavid Conrad <lessen42@gmail.com>
Wed, 5 Sep 2007 00:25:54 +0000 (00:25 +0000)
Originally committed as revision 10380 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroskaenc.c

index c4b809f12828128c562a73d8a33c2a1159c0bbdd..5becce4c9e908ed169016805d30ca196921cd60a 100644 (file)
@@ -483,10 +483,15 @@ static int mkv_write_codecprivate(ByteIOContext *pb, AVCodecContext *codec, int
     } else if (codec->codec_type == CODEC_TYPE_VIDEO) {
         if (!codec->codec_tag)
             codec->codec_tag = codec_get_tag(codec_bmp_tags, codec->codec_id);
+        if (!codec->codec_tag) {
+            av_log(codec, AV_LOG_ERROR, "no bmp codec id found");
+            ret = -1;
+        }
 
         put_bmp_header(&dyn_cp, codec, codec_bmp_tags, 0);
 
     } else if (codec->codec_type == CODEC_TYPE_AUDIO) {
+        if (!codec->codec_tag)
         codec->codec_tag = codec_get_tag(codec_wav_tags, codec->codec_id);
         if (!codec->codec_tag) {
             av_log(codec, AV_LOG_ERROR, "no wav codec id found");