diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-29 13:58:57 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-29 14:00:44 +0100 |
commit | d7b20bfbb582c369518c73720fb4b0266714cde6 (patch) | |
tree | 27dfaa2c3e2f273e661555336b6ed6d6b9eb9e5e /libavformat/nuv.c | |
parent | 076300bf8b43d5d56a91cd2ad845d596969c87cf (diff) | |
parent | 5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66 (diff) | |
download | ffmpeg-d7b20bfbb582c369518c73720fb4b0266714cde6.tar.gz |
Merge commit '5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66'
* commit '5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66':
lavf: move nuv fourcc audio tags from riff to nuv
lavf: add a common function for selecting a pcm codec from parameters
Conflicts:
libavformat/internal.h
libavformat/mov.c
libavformat/riff.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/nuv.c')
-rw-r--r-- | libavformat/nuv.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index c67c1fa695..37d92e284f 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -26,6 +26,12 @@ #include "internal.h" #include "riff.h" +static const AVCodecTag nuv_audio_tags[] = { + { AV_CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') }, + { AV_CODEC_ID_MP3, MKTAG('L', 'A', 'M', 'E') }, + { AV_CODEC_ID_NONE, 0 }, +}; + typedef struct { int v_id; int a_id; @@ -96,14 +102,25 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, avio_skip(pb, 4); if (ast) { + int id; + ast->codec->codec_tag = avio_rl32(pb); ast->codec->sample_rate = avio_rl32(pb); ast->codec->bits_per_coded_sample = avio_rl32(pb); ast->codec->channels = avio_rl32(pb); ast->codec->channel_layout = 0; - ast->codec->codec_id = - ff_wav_codec_get_id(ast->codec->codec_tag, - ast->codec->bits_per_coded_sample); + + id = ff_wav_codec_get_id(ast->codec->codec_tag, + ast->codec->bits_per_coded_sample); + if (id == AV_CODEC_ID_NONE) { + id = ff_codec_get_id(nuv_audio_tags, + ast->codec->codec_tag); + if (id == AV_CODEC_ID_PCM_S16LE) + id = ff_get_pcm_codec_id(ast->codec->bits_per_coded_sample, + 0, 0, ~1); + } + ast->codec->codec_id = id; + ast->need_parsing = AVSTREAM_PARSE_FULL; } else avio_skip(pb, 4 * 4); |