]> git.sesse.net Git - vlc/blobdiff - plugins/mpeg/input_ps.c
* Bug fixes and enhancements in the Gtk+/Gnome interfaces.
[vlc] / plugins / mpeg / input_ps.c
index b000fcf240be3e88e1a2615460df41af4ed06cf5..b9190e360daba5e7656f804063057e76bd618467 100644 (file)
@@ -2,7 +2,7 @@
  * input_ps.c: PS demux and packet management
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ps.c,v 1.6 2001/02/16 09:25:03 sam Exp $
+ * $Id: input_ps.c,v 1.11 2001/03/15 01:42:20 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -21,6 +21,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define MODULE_NAME ps
+#include "modules_inner.h"
+
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
@@ -76,7 +79,7 @@ static void DeletePES   ( void *, struct pes_packet_s * );
  * Functions exported as capabilities. They are declared as static so that
  * we don't pollute the namespace too much.
  *****************************************************************************/
-void input_getfunctions( function_list_t * p_function_list )
+void _M( input_getfunctions )( function_list_t * p_function_list )
 {
 #define input p_function_list->functions.input
     p_function_list->pf_probe = PSProbe;
@@ -84,6 +87,7 @@ void input_getfunctions( function_list_t * p_function_list )
     input.pf_open             = input_FileOpen;
     input.pf_close            = input_FileClose;
     input.pf_end              = PSEnd;
+    input.pf_set_area         = NULL;
     input.pf_read             = PSRead;
     input.pf_demux            = input_DemuxPS;
     input.pf_new_packet       = NewPacket;
@@ -201,14 +205,15 @@ static void PSInit( input_thread_t * p_input )
             }
 
             /* File too big. */
-            if( p_input->stream.i_tell > INPUT_PREPARSE_LENGTH )
+            if( p_input->stream.p_selected_area->i_tell >
+                                                    INPUT_PREPARSE_LENGTH )
             {
                 break;
             }
         }
         rewind( p_method->stream );
         vlc_mutex_lock( &p_input->stream.stream_lock );
-        p_input->stream.i_tell = 0;
+        p_input->stream.p_selected_area->i_tell = 0;
         if( p_demux_data->b_has_PSM )
         {
             /* (The PSM decoder will care about spawning the decoders) */
@@ -296,7 +301,6 @@ static void PSInit( input_thread_t * p_input )
  *****************************************************************************/
 static void PSEnd( input_thread_t * p_input )
 {
-    free( p_input->stream.p_demux_data );
     free( p_input->p_plugin_data );
 }
 
@@ -324,7 +328,7 @@ static __inline__ int SafeRead( input_thread_t * p_input, byte_t * p_buffer,
         }
     }
     vlc_mutex_lock( &p_input->stream.stream_lock );
-    p_input->stream.i_tell += i_len;
+    p_input->stream.p_selected_area->i_tell += i_len;
     vlc_mutex_unlock( &p_input->stream.stream_lock );
     return( 0 );
 }
@@ -367,7 +371,7 @@ static int PSRead( input_thread_t * p_input,
                 /* It is common for MPEG-1 streams to pad with zeros
                  * (although it is forbidden by the recommendation), so
                  * don't bother everybody in this case. */
-                intf_WarnMsg( 1, "Garbage at input (%x)", i_startcode );
+                intf_WarnMsg( 1, "Garbage at input (%.8x)", i_startcode );
             }
 
             while( (i_startcode & 0xFFFFFF00) != 0x100L )
@@ -466,7 +470,7 @@ static void PSSeek( input_thread_t * p_input, off_t i_position )
     /* A little bourrin but should work for a while --Meuuh */
     fseeko( p_method->stream, i_position, SEEK_SET );
 
-    p_input->stream.i_tell = i_position;
+    p_input->stream.p_selected_area->i_tell = i_position;
 }
 
 /*