changeset 2511:0ca390638aa5 libavformat

Match the behaviour betwen the bmp and wav codec tag lookups
author conrad
date Wed, 05 Sep 2007 00:25:54 +0000
parents 4ba8d5f648a4
children d66e476c9d24
files matroskaenc.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Wed Sep 05 00:25:52 2007 +0000
+++ b/matroskaenc.c	Wed Sep 05 00:25:54 2007 +0000
@@ -483,10 +483,15 @@
     } 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");