changeset 5886:b8f2b5431f1e libavformat

Matroska muxer : Don't create audio tracks for unsupported audio codecs.
author jai_menon
date Thu, 25 Mar 2010 14:34:19 +0000
parents a1a309c4a751
children 40f886c94f83
files matroskaenc.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Thu Mar 25 13:58:26 2010 +0000
+++ b/matroskaenc.c	Thu Mar 25 14:34:19 2010 +0000
@@ -493,12 +493,14 @@
         }
 
     } else if (codec->codec_type == CODEC_TYPE_AUDIO) {
-        if (!codec->codec_tag)
-            codec->codec_tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
-        if (!codec->codec_tag) {
+        unsigned int tag;
+        tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
+        if (!tag) {
             av_log(s, AV_LOG_ERROR, "No wav codec ID found.\n");
             ret = -1;
         }
+        if (!codec->codec_tag)
+            codec->codec_tag = tag;
 
         ff_put_wav_header(dyn_cp, codec);
     }