riff: fix decoding of 24-bit packed int (type 1, 20-bit)
authorPiotr Bandurski <ami_stuff@o2.pl>
Sat, 24 Nov 2012 09:54:38 +0000 (10:54 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 24 Nov 2012 09:54:38 +0000 (10:54 +0100)
libavformat/riff.c

index 89296e8..9a37760 100644 (file)
@@ -759,7 +759,8 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
     /* 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)
+    if (id == AV_CODEC_ID_PCM_S16LE && bps == 20 ||
+        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;