[vlc-commits] Fix Duck DK3/DK4 ADPCM mappings
Daniel Verkamp
git at videolan.org
Sat Nov 9 11:18:49 CET 2013
vlc | branch: master | Daniel Verkamp <daniel at drv.nu> | Fri Nov 8 22:38:22 2013 -0700| [c7283a40537b142cf5da0ec2022e9c02c9b51d8c] | committer: Rafaël Carré
Fix Duck DK3/DK4 ADPCM mappings
Also give them VLC_CODEC_ names and use them in the adpcm decoder.
v2: Add codec description strings
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7283a40537b142cf5da0ec2022e9c02c9b51d8c
---
include/vlc_codecs.h | 9 ++++-----
include/vlc_fourcc.h | 2 ++
modules/codec/adpcm.c | 8 ++++----
src/misc/fourcc.c | 6 ++++++
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h
index 15f350b..4461374 100644
--- a/include/vlc_codecs.h
+++ b/include/vlc_codecs.h
@@ -271,9 +271,8 @@ ATTR_PACKED
#define WAVE_FORMAT_GSM_AMR_FIXED 0x7A21 /* Fixed bitrate, no SID */
#define WAVE_FORMAT_GSM_AMR 0x7A22 /* Variable bitrate, including SID */
-/* Need to check these */
-#define WAVE_FORMAT_DK3 0x0061
-#define WAVE_FORMAT_DK4 0x0062
+#define WAVE_FORMAT_DK3 0x0062
+#define WAVE_FORMAT_DK4 0x0061
/* At least libavformat use that ID: from libavformat/riff.c ('Vo' == 0x566f)
* { CODEC_ID_VORBIS, ('V'<<8)+'o' }, //HACK/FIXME, does vorbis in WAV/AVI have an (in)official id?
@@ -387,8 +386,8 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_WMAS, VLC_CODEC_WMAS, "Window Media Audio 9 Speech" },
{ WAVE_FORMAT_ATRAC3, VLC_CODEC_ATRAC3, "Sony Atrac3" },
{ WAVE_FORMAT_SONY_ATRAC3,VLC_CODEC_ATRAC3, "Sony Atrac3" },
- { WAVE_FORMAT_DK3, VLC_FOURCC( 'm', 's', 0x00,0x61), "Duck DK3" },
- { WAVE_FORMAT_DK4, VLC_FOURCC( 'm', 's', 0x00,0x62), "Duck DK4" },
+ { WAVE_FORMAT_DK3, VLC_CODEC_ADPCM_DK3, "Duck DK3" },
+ { WAVE_FORMAT_DK4, VLC_CODEC_ADPCM_DK4, "Duck DK4" },
{ WAVE_FORMAT_DTS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DTS_MS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DIVIO_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio (Divio)" },
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index c878d8a..abbfb12 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -306,6 +306,8 @@
#define VLC_CODEC_ADPCM_IMA_AMV VLC_FOURCC('i','m','a','v')
#define VLC_CODEC_ADPCM_IMA_QT VLC_FOURCC('i','m','a','4')
#define VLC_CODEC_ADPCM_YAMAHA VLC_FOURCC('m','s',0x00,0x20)
+#define VLC_CODEC_ADPCM_DK3 VLC_FOURCC('m','s',0x00,0x62)
+#define VLC_CODEC_ADPCM_DK4 VLC_FOURCC('m','s',0x00,0x61)
#define VLC_CODEC_G723_1 VLC_FOURCC('g','7','2', 0x31)
#define VLC_CODEC_G729 VLC_FOURCC('g','7','2','9')
#define VLC_CODEC_VMDAUDIO VLC_FOURCC('v','m','d','a')
diff --git a/modules/codec/adpcm.c b/modules/codec/adpcm.c
index cdeb5b0..f3bfffd 100644
--- a/modules/codec/adpcm.c
+++ b/modules/codec/adpcm.c
@@ -141,8 +141,8 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_FOURCC('i','m','a', '4'): /* IMA ADPCM */
case VLC_FOURCC('m','s',0x00,0x02): /* MS ADPCM */
case VLC_FOURCC('m','s',0x00,0x11): /* IMA ADPCM */
- case VLC_FOURCC('m','s',0x00,0x61): /* Duck DK4 ADPCM */
- case VLC_FOURCC('m','s',0x00,0x62): /* Duck DK3 ADPCM */
+ case VLC_CODEC_ADPCM_DK3:
+ case VLC_CODEC_ADPCM_DK4:
case VLC_FOURCC('X','A','J', 0): /* EA ADPCM */
break;
default:
@@ -179,10 +179,10 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_CODEC_ADPCM_MS: /* MS ADPCM */
p_sys->codec = ADPCM_MS;
break;
- case VLC_FOURCC('m','s',0x00,0x61): /* Duck DK4 ADPCM */
+ case VLC_CODEC_ADPCM_DK4: /* Duck DK4 ADPCM */
p_sys->codec = ADPCM_DK4;
break;
- case VLC_FOURCC('m','s',0x00,0x62): /* Duck DK3 ADPCM */
+ case VLC_CODEC_ADPCM_DK3: /* Duck DK3 ADPCM */
p_sys->codec = ADPCM_DK3;
break;
case VLC_FOURCC('X','A','J', 0): /* EA ADPCM */
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 2ef4372..5cd04fd 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -1169,6 +1169,12 @@ static const staticentry_t p_list_audio[] = {
B(VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM Audio" ),
A("ms\x00\x20"),
+ B(VLC_CODEC_ADPCM_DK3, "Duck DK3 ADPCM"),
+ A("ms\x00\x62"),
+
+ B(VLC_CODEC_ADPCM_DK4, "Duck DK4 ADPCM"),
+ A("ms\x00\x61"),
+
/* AMR */
B(VLC_CODEC_AMR_NB, "AMR narrow band"),
A("samr"),
More information about the vlc-commits
mailing list