]> git.sesse.net Git - vlc/commitdiff
Only pre-parse the first 32 MB of data.
authorChristophe Massiot <massiot@videolan.org>
Wed, 20 Dec 2000 18:45:43 +0000 (18:45 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 20 Dec 2000 18:45:43 +0000 (18:45 +0000)
include/config.h.in
src/input/input_ps.c

index 3ac0066d583b74608a167b36187ef824cd6f7e6c..df059e9bd16b10526a358e1faba25ef30a0f0e10 100644 (file)
  * General limitations
  */
 
-/* Broadcast address, in case of a broadcasted stream */
-#define INPUT_BCAST_ADDR                "138.195.143.255"
-
 /* Maximum number of input threads - this value is used exclusively by
  * interface, and is in fact an interface limitation */
 #define INPUT_MAX_THREADS               10
 /* Maximum size of a data packet (128 kB) */
 #define INPUT_MAX_PACKET_SIZE                  131072
 
+/* Maximum length of a pre-parsed chunk (32 MB) */
+#define INPUT_PREPARSE_LENGTH                  33554432
+
 /* Maximum length of a hostname or source name */
 #define INPUT_MAX_SOURCE_LENGTH         100
 
index 958433451201d88225b1b60c6e4319d834880752..48cc24a33d068894ecc946abbc17a89370cc591f 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.7 2000/12/20 16:04:31 massiot Exp $
+ * $Id: input_ps.c,v 1.8 2000/12/20 18:45:43 massiot Exp $
  *
  * Authors: 
  *
@@ -127,6 +127,12 @@ static void PSInit( input_thread_t * p_input )
                 /* FIXME: use i_p_config_t */
                 input_ParsePS( p_input, pp_packets[i] );
             }
+
+            /* File too big. */
+            if( p_input->stream.i_tell > INPUT_PREPARSE_LENGTH )
+            {
+                break;
+            }
         }
         fseek( p_method->stream, 0, SEEK_SET );
         vlc_mutex_lock( &p_input->stream.stream_lock );