[vlc-devel] commit: Added MLP support to es demuxer. (Laurent Aimar )
git version control
git at videolan.org
Sat Nov 29 10:53:19 CET 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Nov 28 21:34:44 2008 +0100| [8e550e858819f8d06fd36be9bdc721d19a58d01a] | committer: Laurent Aimar
Added MLP support to es demuxer.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e550e858819f8d06fd36be9bdc721d19a58d01a
---
modules/demux/mpeg/es.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index dbac5da..7c12cc8 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -45,7 +45,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_DEMUX )
- set_description( N_("MPEG-I/II/4 / A52 / DTS audio" ) )
+ set_description( N_("MPEG-I/II/4 / A52 / DTS / MLP audio" ) )
set_capability( "demux", 155 )
set_callbacks( Open, Close )
@@ -62,6 +62,8 @@ vlc_module_begin ()
add_shortcut( "eac3" )
add_shortcut( "dts" )
+
+ add_shortcut( "mlp" )
vlc_module_end ()
/*****************************************************************************
@@ -125,12 +127,16 @@ static int A52Init( demux_t *p_demux );
static int DtsProbe( demux_t *p_demux, int64_t *pi_offset );
static int DtsInit( demux_t *p_demux );
+static int MlpProbe( demux_t *p_demux, int64_t *pi_offset );
+static int MlpInit( demux_t *p_demux );
+
static const codec_t p_codec[] = {
{ VLC_FOURCC( 'm', 'p', '4', 'a' ), false, "mp4 audio", AacProbe, AacInit },
{ VLC_FOURCC( 'm', 'p', 'g', 'a' ), false, "mpeg audio", MpgaProbe, MpgaInit },
{ VLC_FOURCC( 'a', '5', '2', ' ' ), true, "a52 audio", A52Probe, A52Init },
{ VLC_FOURCC( 'e', 'a', 'c', '3' ), true, "eac3 audio", EA52Probe, A52Init },
{ VLC_FOURCC( 'd', 't', 's', ' ' ), false, "dts audio", DtsProbe, DtsInit },
+ { VLC_FOURCC( 'm', 'l', 'p', ' ' ), false, "mlp audio", MlpProbe, MlpInit },
{ 0, false, NULL, NULL, NULL }
};
@@ -799,3 +805,34 @@ static int DtsInit( demux_t *p_demux )
return VLC_SUCCESS;
}
+/*****************************************************************************
+ * MLP
+ *****************************************************************************/
+static bool MlpCheckSync( const uint8_t *p_peek )
+{
+ if( p_peek[4+0] != 0xf8 || p_peek[4+1] != 0x72 || p_peek[4+2] != 0x6f )
+ return false;
+
+ if( p_peek[4+3] != 0xba && p_peek[4+3] != 0xbb )
+ return false;
+
+ /* TODO checksum */
+
+ return true;
+}
+static int MlpProbe( demux_t *p_demux, int64_t *pi_offset )
+{
+ const char *ppsz_name[] = { "mlp", NULL };
+
+ return GenericProbe( p_demux, pi_offset, ppsz_name, MlpCheckSync, 4+28+16*4 );
+}
+static int MlpInit( demux_t *p_demux )
+
+{
+ demux_sys_t *p_sys = p_demux->p_sys;
+
+ p_sys->i_packet_size = 4096;
+
+ return VLC_SUCCESS;
+}
+
More information about the vlc-devel
mailing list