]> git.sesse.net Git - vlc/blobdiff - modules/demux/dts.c
Qt4 - SPrefs, save the access-filter.
[vlc] / modules / demux / dts.c
index f8d1105cf634d1f180c418f1a87a3cfb71a7ec73..d448e07a1c176533e8723b34708488fc81955d88 100644 (file)
@@ -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 <gbazin@netcourrier.com>
@@ -25,7 +25,7 @@
  * Preamble
  *****************************************************************************/
 #include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_demux.h>
 #include <vlc_codec.h>
 
 /*****************************************************************************
@@ -60,7 +60,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 +73,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 +140,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 +236,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 &&