aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/riff.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-11-27 14:52:38 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-28 11:18:50 -0500
commit261e9348ef377efc8672c6f8ade974cee7db8e49 (patch)
treeff98f739e44a47e958e029c54026725b0f610cb5 /libavformat/riff.c
parentbfe5454cd238b16e7977085f880205229103eccb (diff)
downloadffmpeg-261e9348ef377efc8672c6f8ade974cee7db8e49.tar.gz
lavf: add a common function for selecting a pcm codec from parameters
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r--libavformat/riff.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index fde11317fe..475486da82 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -678,15 +678,12 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
id = ff_codec_get_id(ff_codec_wav_tags, tag);
if (id <= 0)
return id;
- /* handle specific u8 codec */
- if (id == AV_CODEC_ID_PCM_S16LE && bps == 8)
- id = AV_CODEC_ID_PCM_U8;
- if (id == AV_CODEC_ID_PCM_S16LE && bps == 24)
- id = AV_CODEC_ID_PCM_S24LE;
- if (id == AV_CODEC_ID_PCM_S16LE && bps == 32)
- id = AV_CODEC_ID_PCM_S32LE;
- if (id == AV_CODEC_ID_PCM_F32LE && bps == 64)
- id = AV_CODEC_ID_PCM_F64LE;
+
+ if (id == AV_CODEC_ID_PCM_S16LE)
+ id = ff_get_pcm_codec_id(bps, 0, 0, ~1);
+ else if (id == AV_CODEC_ID_PCM_F32LE)
+ id = ff_get_pcm_codec_id(bps, 1, 0, 0);
+
if (id == AV_CODEC_ID_ADPCM_IMA_WAV && bps == 8)
id = AV_CODEC_ID_PCM_ZORK;
return id;