[vlc-devel] commit: Wav GSM Demuxer Support Fixes Wav demux to work with MS-GSM codec. Uses ffmpeg decoder. (Srikanth Raju )
git version control
git at videolan.org
Sat Mar 28 16:10:19 CET 2009
vlc | branch: master | Srikanth Raju <srikiraju at gmail dot com> | Sat Mar 28 02:52:12 2009 +0530| [aaddb130d42824b0f63e48059efd1c2829a30dac] | committer: Laurent Aimar
Wav GSM Demuxer Support Fixes Wav demux to work with MS-GSM codec. Uses ffmpeg decoder.
Signed-off-by: Laurent Aimar <fenrir at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aaddb130d42824b0f63e48059efd1c2829a30dac
---
include/vlc_codecs.h | 2 +-
modules/codec/avcodec/fourcc.c | 2 +-
modules/demux/wav.c | 15 +++++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h
index d31b539..85176d0 100644
--- a/include/vlc_codecs.h
+++ b/include/vlc_codecs.h
@@ -305,7 +305,7 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-ADPCM" },
- { WAVE_FORMAT_GSM610, VLC_FOURCC( 'g', 's', 'm', ' ' ), "GSM 610" },
+ { WAVE_FORMAT_GSM610, VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
{ WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
{ WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 3886875..6f8fc83 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -1046,7 +1046,7 @@ static const struct
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 34, 0 )
{ VLC_FOURCC('g','s','m',' '), CODEC_ID_GSM,
AUDIO_ES, "GSM Audio" },
- { VLC_FOURCC('g','s','m','s'), CODEC_ID_GSM_MS,
+ { VLC_FOURCC('a','g','s','m'), CODEC_ID_GSM_MS, /* According to http://wiki.multimedia.cx/index.php?title=GSM */
AUDIO_ES, "Microsoft GSM Audio" },
#endif
diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index be7f848..cf66ce9 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -78,6 +78,7 @@ static int ChunkFind( demux_t *, const char *, unsigned int * );
static void FrameInfo_IMA_ADPCM( demux_t *, unsigned int *, int * );
static void FrameInfo_MS_ADPCM ( demux_t *, unsigned int *, int * );
static void FrameInfo_PCM ( demux_t *, unsigned int *, int * );
+static void FrameInfo_MSGSM ( demux_t *, unsigned int *, int * );
static const uint32_t pi_channels_src[] =
{ WAVE_SPEAKER_FRONT_LEFT, WAVE_SPEAKER_FRONT_RIGHT,
@@ -263,6 +264,10 @@ static int Open( vlc_object_t * p_this )
case VLC_FOURCC( 'a', '5', '2', ' ' ):
/* FIXME set end of area FIXME */
goto error;
+ case VLC_FOURCC( 'a', 'g', 's', 'm' ):
+ FrameInfo_MSGSM( p_demux, &p_sys->i_frame_size,
+ &p_sys->i_frame_samples );
+ break;
default:
msg_Err( p_demux, "unsupported codec (%4.4s)",
(char*)&p_sys->fmt.i_codec );
@@ -454,3 +459,13 @@ static void FrameInfo_IMA_ADPCM( demux_t *p_demux, unsigned int *pi_size,
*pi_size = p_sys->fmt.audio.i_blockalign;
}
+
+static void FrameInfo_MSGSM( demux_t *p_demux, unsigned int *pi_size,
+ int *pi_samples )
+{
+ demux_sys_t *p_sys = p_demux->p_sys;
+
+ *pi_samples = ( p_sys->fmt.audio.i_blockalign * p_sys->fmt.audio.i_rate * 8)
+ / p_sys->fmt.i_bitrate;
+ *pi_size = p_sys->fmt.audio.i_blockalign;
+}
More information about the vlc-devel
mailing list