]> git.sesse.net Git - vlc/blobdiff - src/input/stream.c
Fix a double vlc_object_release (partially fix the update system)
[vlc] / src / input / stream.c
index b469a901402948e40635d161ee10c7d364d5fb0b..567c11593e929f9617cb729bf6642f08814654b4 100644 (file)
@@ -535,7 +535,6 @@ static void UStreamDestroy( stream_t *s )
 {
     access_t *p_access = (access_t *)s->p_parent;
     AStreamDestroy( s );
-    vlc_object_release( p_access );
     access_Delete( p_access );
 }
 
@@ -1872,6 +1871,8 @@ static int AReadStream( stream_t *s, void *p_read, int i_read )
     if( !p_sys->i_list )
     {
         i_read = p_access->pf_read( p_access, p_read, i_read );
+        if( p_access->b_die )
+            vlc_object_kill( s );
         if( p_input )
         {
             vlc_mutex_lock( &p_input->p->counters.counters_lock );
@@ -1887,6 +1888,8 @@ static int AReadStream( stream_t *s, void *p_read, int i_read )
 
     i_read = p_sys->p_list_access->pf_read( p_sys->p_list_access, p_read,
                                             i_read );
+    if( p_access->b_die )
+        vlc_object_kill( s );
 
     /* If we reached an EOF then switch to the next stream in the list */
     if( i_read == 0 && p_sys->i_list_index + 1 < p_sys->i_list )
@@ -1938,6 +1941,8 @@ static block_t *AReadBlock( stream_t *s, bool *pb_eof )
     if( !p_sys->i_list )
     {
         p_block = p_access->pf_block( p_access );
+        if( p_access->b_die )
+            vlc_object_kill( s );
         if( pb_eof ) *pb_eof = p_access->info.b_eof;
         if( p_input && p_block && libvlc_stats (p_access) )
         {
@@ -1953,6 +1958,8 @@ static block_t *AReadBlock( stream_t *s, bool *pb_eof )
     }
 
     p_block = p_sys->p_list_access->pf_block( p_access );
+    if( p_access->b_die )
+        vlc_object_kill( s );
     b_eof = p_sys->p_list_access->info.b_eof;
     if( pb_eof ) *pb_eof = b_eof;