X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fdts.c;h=c5e956e41816f9c68d1c103c0e8f239761e02c4e;hb=546844365d9004af8e12f6386d2086700e6cfbe1;hp=f8d1105cf634d1f180c418f1a87a3cfb71a7ec73;hpb=90a4caea90dbbb8c8b6d3a78f1671083b8694637;p=vlc diff --git a/modules/demux/dts.c b/modules/demux/dts.c index f8d1105cf6..c5e956e418 100644 --- a/modules/demux/dts.c +++ b/modules/demux/dts.c @@ -1,7 +1,7 @@ /***************************************************************************** * 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 @@ -24,8 +24,12 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include -#include +#include #include /***************************************************************************** @@ -60,7 +64,7 @@ struct demux_sys_t 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) @@ -73,7 +77,7 @@ static int Open( vlc_object_t * p_this ) { 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 */ @@ -140,17 +144,16 @@ static int Open( vlc_object_t * p_this ) if( CheckSync( p_peek + i_peek ) != VLC_SUCCESS ) { - if( strncmp( p_demux->psz_demux, "dts", 3 ) ) - { + if( !p_demux->b_force ) return VLC_EGENERIC; - } + /* User forced */ msg_Err( p_demux, "this doesn't look like a DTS audio stream, " "continuing anyway" ); } - STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys; - + DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys; + INIT_APACKETIZER( p_sys->p_packetizer, 'd','t','s',' ' ); LOAD_PACKETIZER_OR_FAIL( p_sys->p_packetizer, "DTS" ); @@ -237,7 +240,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) /***************************************************************************** * 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 &&