diff options
author | rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-20 12:57:53 +0000 |
---|---|---|
committer | rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-20 12:57:53 +0000 |
commit | a27f74e98c21eb3a4006403529d90e1a41a3d68a (patch) | |
tree | 9d75b24243f6182cb05efea64212f54505fcad98 | |
parent | 555dd1cfedc89cf3e9163628cb4eab4cc2c9429d (diff) | |
download | mpv-a27f74e98c21eb3a4006403529d90e1a41a3d68a.tar.bz2 mpv-a27f74e98c21eb3a4006403529d90e1a41a3d68a.tar.xz |
Allow overriding the codec_tag for audio codecs, and always override
codec_tag for PCM codecs (codec_id from lavf is correct, but the
codec_tag may be non-zero and wrong).
Also fixes bugzilla #983
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25817 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demux_lavf.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index f906f66887..cc8f509654 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -92,9 +92,6 @@ static const AVCodecTag mp_wav_tags[] = { { CODEC_ID_MUSEPACK7, MKTAG('M', 'P', 'C', ' ')}, { CODEC_ID_MUSEPACK8, MKTAG('M', 'P', 'C', '8')}, { CODEC_ID_NELLYMOSER, MKTAG('N', 'E', 'L', 'L')}, - { CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')}, - { CODEC_ID_PCM_S16BE, MKTAG('t', 'w', 'o', 's')}, - { CODEC_ID_PCM_S8, MKTAG('t', 'w', 'o', 's')}, { CODEC_ID_ROQ_DPCM, MKTAG('R', 'o', 'Q', 'A')}, { CODEC_ID_SHORTEN, MKTAG('s', 'h', 'r', 'n')}, { CODEC_ID_TTA, MKTAG('T', 'T', 'A', '1')}, @@ -106,6 +103,17 @@ static const AVCodecTag mp_wav_tags[] = { const struct AVCodecTag *mp_wav_taglists[] = {codec_wav_tags, mp_wav_tags, 0}; +static const AVCodecTag mp_wav_override_tags[] = { + { CODEC_ID_PCM_S8, MKTAG('t', 'w', 'o', 's')}, + { CODEC_ID_PCM_U8, 0}, + { CODEC_ID_PCM_S16BE, MKTAG('t', 'w', 'o', 's')}, + { CODEC_ID_PCM_S16LE, 0}, + { CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')}, + { 0, 0 }, +}; + +const struct AVCodecTag *mp_wav_override_taglists[] = {mp_wav_override_tags, 0}; + static const AVCodecTag mp_bmp_tags[] = { { CODEC_ID_AMV, MKTAG('A', 'M', 'V', 'V')}, { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')}, @@ -271,6 +279,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { break; priv->astreams[priv->audio_streams] = i; priv->audio_streams++; + // For some formats (like PCM) always trust CODEC_ID_* more than codec_tag + codec->codec_tag= av_codec_get_tag(mp_wav_override_taglists, codec->codec_id); // mp4a tag is used for all mp4 files no matter what they actually contain if(codec->codec_tag == MKTAG('m', 'p', '4', 'a')) codec->codec_tag= 0; |