]> git.sesse.net Git - vlc/commitdiff
* backport of [11500] [11501] and [11502]
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 23 Jun 2005 15:14:36 +0000 (15:14 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 23 Jun 2005 15:14:36 +0000 (15:14 +0000)
modules/demux/livedotcom.cpp
modules/demux/mkv.cpp
modules/gui/macosx/playlist.m

index d1dae7bc4ce292cf9c6e934c5a7c0fdd33fdb62f..e7fbfd84187e0f4c14bebcea579c5c4bf64c339f 100644 (file)
@@ -769,8 +769,10 @@ static int Demux( demux_t *p_demux )
 
     if( p_sys->b_multicast && p_sys->b_no_data && p_sys->i_no_data_ti > 120 )
     {
+        /* FIXME Make this configurable
         msg_Err( p_demux, "no multicast data received in 36s, aborting" );
         return 0;
+        */
     }
     else if( !p_sys->b_multicast && p_sys->b_no_data && p_sys->i_no_data_ti > 3 )
     {
@@ -792,7 +794,7 @@ static int Demux( demux_t *p_demux )
             return 0;
         }
     }
-    else if( p_sys->i_no_data_ti > 10 )
+    else if( !p_sys->b_multicast && p_sys->b_no_data&& p_sys->i_no_data_ti > 10 )
     {
         /* EOF ? */
         msg_Warn( p_demux, "no data received in 3s, eof ?" );
index 0a0df378ea9dac1368bdbaecfdebdab991c9e0a2..0ffd88c6c72b5a79f0affab0cb7dda8314a33b80 100644 (file)
@@ -492,9 +492,16 @@ class vlc_stream_io_callback: public IOCallback
   private:
     stream_t       *s;
     vlc_bool_t     mb_eof;
+    vlc_bool_t     b_owner;
 
   public:
-    vlc_stream_io_callback( stream_t * );
+    vlc_stream_io_callback( stream_t *, vlc_bool_t );
+
+    virtual ~vlc_stream_io_callback()
+    {
+        if( b_owner )
+            stream_Delete( s );
+    }
 
     virtual uint32   read            ( void *p_buffer, size_t i_size);
     virtual void     setFilePointer  ( int64_t i_offset, seek_mode mode = seek_beginning );
@@ -1392,7 +1399,7 @@ static int Open( vlc_object_t * p_this )
     p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = new demux_sys_t( *p_demux );
 
-    p_io_callback = new vlc_stream_io_callback( p_demux->s );
+    p_io_callback = new vlc_stream_io_callback( p_demux->s, VLC_FALSE );
     p_io_stream = new EbmlStream( *p_io_callback );
 
     if( p_io_stream == NULL )
@@ -1469,7 +1476,7 @@ static int Open( vlc_object_t * p_this )
 #endif
                     {
                         // test wether this file belongs to our family
-                        vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( stream_UrlNew( p_demux, s_filename.c_str()));
+                        vlc_stream_io_callback *p_file_io = new vlc_stream_io_callback( stream_UrlNew( p_demux, s_filename.c_str()), VLC_TRUE );
                         EbmlStream *p_estream = new EbmlStream(*p_file_io);
 
                         p_stream = p_sys->AnalyseAllSegmentsFound( p_estream );
@@ -3224,9 +3231,10 @@ static int Demux( demux_t *p_demux)
 /*****************************************************************************
  * Stream managment
  *****************************************************************************/
-vlc_stream_io_callback::vlc_stream_io_callback( stream_t *s_ )
+vlc_stream_io_callback::vlc_stream_io_callback( stream_t *s_, vlc_bool_t b_owner_ )
 {
     s = s_;
+    b_owner = b_owner_;
     mb_eof = VLC_FALSE;
 }
 
index b3b6fccbc2f9a2ca6beb46aaeb56086bbd387fb4..40a51678615bd3f4287e9b4e2e6fa6e29ca7cec4 100644 (file)
@@ -925,7 +925,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         }
         if( o_result != NULL )
         {
-            for( i = 1 ; i < [o_result count] - 1 ; i++ )
+            int i_start;
+            if( [[o_result objectAtIndex: 0] pointerValue] ==
+                                                    p_playlist->p_general )
+            i_start = 1;
+            else
+            i_start = 0;
+
+            for( i = i_start ; i < [o_result count] - 1 ; i++ )
             {
                 [o_outline_view expandItem: [o_outline_dict objectForKey:
                             [NSString stringWithFormat: @"%p",