Matroska muxer : Don't create audio tracks for unsupported audio codecs.

Originally committed as revision 22669 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Jai Menon 2010-03-25 14:34:19 +00:00
parent b26708d5d1
commit 4896dd57fa

View File

@ -493,12 +493,14 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec
} }
} else if (codec->codec_type == CODEC_TYPE_AUDIO) { } else if (codec->codec_type == CODEC_TYPE_AUDIO) {
if (!codec->codec_tag) unsigned int tag;
codec->codec_tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
if (!codec->codec_tag) { if (!tag) {
av_log(s, AV_LOG_ERROR, "No wav codec ID found.\n"); av_log(s, AV_LOG_ERROR, "No wav codec ID found.\n");
ret = -1; ret = -1;
} }
if (!codec->codec_tag)
codec->codec_tag = tag;
ff_put_wav_header(dyn_cp, codec); ff_put_wav_header(dyn_cp, codec);
} }