/*****************************************************************************
* dts.c : raw DTS stream input module for vlc
*****************************************************************************
- * Copyright (C) 2001 the VideoLAN team
+ * Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_demux.h>
#include <vlc_codec.h>
/*****************************************************************************
int i_mux_rate;
};
-static int CheckSync( uint8_t *p_peek );
+static int CheckSync( const uint8_t *p_peek );
#define DTS_PACKET_SIZE 16384
#define DTS_PROBE_SIZE (DTS_PACKET_SIZE * 4)
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- byte_t * p_peek;
+ const byte_t *p_peek;
int i_peek = 0;
/* Check if we are dealing with a WAV file */
}
STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
-
- INIT_PACKETIZER( 'd','t','s',' ' );
- LOAD_PACKETIZER_OR_FAIL( "DTS" );
+
+ INIT_APACKETIZER( p_sys->p_packetizer, 'd','t','s',' ' );
+ LOAD_PACKETIZER_OR_FAIL( p_sys->p_packetizer, "DTS" );
p_sys->p_es = es_out_Add( p_demux->out, &p_sys->p_packetizer->fmt_in );
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- /* Unneed module */
- module_Unneed( p_sys->p_packetizer, p_sys->p_packetizer->p_module );
-
- /* Delete the decoder */
- vlc_object_destroy( p_sys->p_packetizer );
+ DESTROY_PACKETIZER( p_sys->p_packetizer );
free( p_sys );
}
/*****************************************************************************
* CheckSync: Check if buffer starts with a DTS sync code
*****************************************************************************/
-static int CheckSync( uint8_t *p_peek )
+static int CheckSync( const uint8_t *p_peek )
{
/* 14 bits, little endian version of the bitstream */
if( p_peek[0] == 0xff && p_peek[1] == 0x1f &&