]> git.sesse.net Git - vlc/commitdiff
* Fix reference modules to add after their own playlist position instead of the end...
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 22 Oct 2004 13:53:53 +0000 (13:53 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 22 Oct 2004 13:53:53 +0000 (13:53 +0000)
modules/demux/mp4/mp4.c
modules/misc/sap.c

index 8b9ab087b8e9653839adcbcae485fa36ccacc094..02e3ba723d62f5609d67d75fc5f9ddbe5e5d7845 100644 (file)
@@ -343,6 +343,7 @@ static int Open( vlc_object_t * p_this )
                 MP4_Box_t *p_rdrf = MP4_BoxGet( p_rmra, "rmda[%d]/rdrf", i );
                 char      *psz_ref;
                 uint32_t  i_ref_type;
+                int       i_position = p_playlist->i_index;
 
                 if( !p_rdrf || !( psz_ref = p_rdrf->data.p_rdrf->psz_ref ) )
                 {
@@ -365,7 +366,7 @@ static int Open( vlc_object_t * p_this )
                     {
                         msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
                         playlist_Add( p_playlist, psz_ref, psz_ref,
-                                      PLAYLIST_APPEND, PLAYLIST_END );
+                                      PLAYLIST_APPEND, i_position );
                     }
                     else
                     {
@@ -388,7 +389,7 @@ static int Open( vlc_object_t * p_this )
                         strcat( psz_absolute, psz_ref );
                         msg_Dbg( p_demux, "adding ref = `%s'", psz_absolute );
                         playlist_Add( p_playlist, psz_absolute, psz_absolute,
-                                      PLAYLIST_APPEND, PLAYLIST_END );
+                                      PLAYLIST_APPEND, i_position );
                     }
                 }
                 else
index 6ac41dd4329deb985d87edf3cbab3801473c97da..0215fa9130e1777899f11fd171f96373d316d0ad 100644 (file)
@@ -445,10 +445,9 @@ static void Run( intf_thread_t *p_intf )
                    int i_pos = playlist_GetPositionById( p_playlist,
                               p_intf->p_sys->pp_announces[i]->i_id );
                    playlist_Delete( p_playlist, i_pos );
+                   vlc_object_release( p_playlist );
                }
 
-               vlc_object_release( p_playlist );
-
                /* Free the p_announce */
                p_announce =  p_intf->p_sys->pp_announces[i];
                if( p_announce->psz_name )
@@ -987,7 +986,7 @@ static sess_descr_t *  parse_sdp( vlc_object_t * p_parent, char *p_packet )
         char *psz_end;
 
         /* Search begin of field */
-        while( *p_packet == '\n' || *p_packet == ' ' || *p_packet == '\t' )
+        while( *p_packet == '\r' || *p_packet == '\n' || *p_packet == ' ' || *p_packet == '\t' )
         {
             p_packet++;
         }
@@ -1241,7 +1240,7 @@ static int Demux( demux_t *p_demux )
     }
     
     p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE;
-    i_position = p_playlist->i_index + 1;
+    i_position = p_playlist->i_index;
     
     /* Gather the complete sdp file */
     for( ;; )
@@ -1287,6 +1286,7 @@ static int Demux( demux_t *p_demux )
             i_id = playlist_Add( p_playlist, psz_uri, p_sd->psz_sessionname ,
                           PLAYLIST_CHECK_INSERT, i_position );
             free( psz_uri );
+            vlc_object_release( p_playlist );
             return 0;
         }
         
@@ -1303,6 +1303,7 @@ static int Demux( demux_t *p_demux )
 
             if( !p_sd->pp_media[i_count] )
             {
+                vlc_object_release( p_playlist );
                 return -1;
             }
 
@@ -1311,6 +1312,7 @@ static int Demux( demux_t *p_demux )
 
             if( !psz_proto || !psz_port )
             {
+                vlc_object_release( p_playlist );
                 return -1;
             }
 
@@ -1326,6 +1328,7 @@ static int Demux( demux_t *p_demux )
 
             if( psz_uri == NULL )
             {
+                vlc_object_release( p_playlist );
                 return -1;
             }