]> git.sesse.net Git - vlc/commitdiff
Do not access b_die directly
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 10 Nov 2012 17:22:47 +0000 (19:22 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 10 Nov 2012 17:22:47 +0000 (19:22 +0200)
lib/media_player.c
modules/access/linsys/linsys_hdsdi.c
modules/access/mms/mms.c
modules/access/mms/mmstu.c
modules/stream_filter/smooth/smooth.c
src/input/es_out.c
src/input/stream.c
src/network/io.c
src/playlist/item.c
src/playlist/thread.c

index 2eb524d853251ce66abab0b5287c64788084c0ca..0ac48968cc3784137acaf010cca9e4bd6f985957 100644 (file)
@@ -1230,7 +1230,7 @@ int libvlc_media_player_will_play( libvlc_media_player_t *p_mi )
     if ( !p_input_thread )
         return false;
 
-    b_will_play = !p_input_thread->b_die && !p_input_thread->b_dead;
+    b_will_play = !p_input_thread->b_dead;
     vlc_object_release( p_input_thread );
 
     return b_will_play;
index 457886b2e39d49ec294e0f75d7b2319a880156a6..bc480eeaaf4b6f1675148c86e1ec5e46fba6567d 100644 (file)
@@ -669,7 +669,7 @@ static int InitCapture( demux_t *p_demux )
     }
 
     /* Wait for standard to settle down */
-    while ( !p_demux->b_die )
+    while ( vlc_object_alive(p_demux) )
     {
         struct pollfd pfd[1];
 
@@ -707,7 +707,7 @@ static int InitCapture( demux_t *p_demux )
             }
         }
     }
-    if ( p_demux->b_die )
+    if ( !vlc_object_alive(p_demux) )
     {
         close( p_sys->i_vfd );
         return VLC_EGENERIC;
index f01c1ed694cf69cd803ffc7c3d8a025464aaca8f..50662b812fa15ccbd6dc9e91c7d8bf6ed8f66e35 100644 (file)
@@ -119,7 +119,7 @@ static int Open( vlc_object_t *p_this )
 
     if( MMSTUOpen ( p_access ) )
     {
-        if( p_access->b_die )
+        if( !vlc_object_alive(p_access) )
             return VLC_EGENERIC;
 
         /* try mmsh if mmstu failed */
index 972532babec927377f2151c8b5e9e1069760610d..7ffc20672d2ba86f948ca51ed40e2bca00a5c3a1 100644 (file)
@@ -140,7 +140,7 @@ int  MMSTUOpen( access_t *p_access )
     {   /* first try with TCP and then UDP*/
         if( ( i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_TCP ) ) )
         {
-            if( !p_access->b_die )
+            if( vlc_object_alive(p_access) )
                 i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_UDP );
         }
     }
index 15bc5f7bb268c74fa91a43c84229bd062c1bb2fb..f0c3d8a783e1bde279415764b5b7a89994f29b06 100644 (file)
@@ -528,7 +528,7 @@ static chunk_t *get_chunk( stream_t *s, const bool wait )
          * that's why vlc_object_alive() has been deprecated. But if I
          * understood well, there is no good solution with a stream_filter
          * module anyaway. */
-        if( !wait || s->b_die || p_sys->b_error )
+        if( !wait || p_sys->b_error )
         {
             vlc_mutex_unlock( &p_sys->download.lock_wait );
             msg_Warn( s, "get_chunk failed! (playback index %u)",
index 1a0053dbb878e00beb7d0303d476d3afd7cb86f6..c5662871657fb8259bb59b007765a771de9aed82 100644 (file)
@@ -2015,7 +2015,7 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
     /* We don't try to reselect */
     if( es->p_dec )
     {
-        while( !p_sys->p_input->b_die && !p_sys->b_buffering && es->p_dec )
+        while( vlc_object_alive(p_sys->p_input) && !p_sys->b_buffering && es->p_dec )
         {
             if( input_DecoderIsEmpty( es->p_dec ) &&
                 ( !es->p_dec_record || input_DecoderIsEmpty( es->p_dec_record ) ))
index fa01b3ee850da98cc7f560a62ee6e5a432e30af6..bf72c7a1536ded6f1c7ea6081da502876aaf37d6 100644 (file)
@@ -662,7 +662,7 @@ static void AStreamPrebufferBlock( stream_t *s )
         bool b_eof;
         block_t *b;
 
-        if( s->b_die || p_sys->block.i_size > STREAM_CACHE_PREBUFFER_SIZE )
+        if( !vlc_object_alive(s) || p_sys->block.i_size > STREAM_CACHE_PREBUFFER_SIZE )
         {
             int64_t i_byterate;
 
@@ -1000,7 +1000,7 @@ static int AStreamRefillBlock( stream_t *s )
     {
         bool b_eof;
 
-        if( s->b_die )
+        if( !vlc_object_alive(s) )
             return VLC_EGENERIC;
 
         /* Fetch a block */
@@ -1356,7 +1356,7 @@ static int AStreamRefillStream( stream_t *s )
         int i_off = tk->i_end % STREAM_CACHE_TRACK_SIZE;
         int i_read;
 
-        if( s->b_die )
+        if( !vlc_object_alive(s) )
             return VLC_EGENERIC;
 
         i_read = __MIN( i_toread, STREAM_CACHE_TRACK_SIZE - i_off );
@@ -1417,7 +1417,7 @@ static void AStreamPrebufferStream( stream_t *s )
         int i_read;
         int i_buffered = tk->i_end - tk->i_start;
 
-        if( s->b_die || i_buffered >= STREAM_CACHE_PREBUFFER_SIZE )
+        if( !vlc_object_alive(s) || i_buffered >= STREAM_CACHE_PREBUFFER_SIZE )
         {
             int64_t i_byterate;
 
index f651a8ecbf5c370413ee3d5821ac9ac7403fc822..7cc9764ad4448a592db07c310186a51b081484b8 100644 (file)
@@ -288,7 +288,6 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
         {
             if (ufd[1].revents)
             {
-                assert (p_this->b_die);
                 msg_Dbg (p_this, "socket %d polling interrupted", fd);
 #if defined(WIN32)
                 WSASetLastError (WSAEINTR);
@@ -442,7 +441,6 @@ ssize_t net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
         {
             if (ufd[1].revents)
             {
-                assert (p_this->b_die);
                 errno = EINTR;
                 goto error;
             }
index 2b99dcedc81bdf516ed6073d734591ccdfe02091..f5fde96e9e2217a9528d0d8dde7189416d8239d5 100644 (file)
@@ -451,7 +451,8 @@ int playlist_AddInput( playlist_t* p_playlist, input_item_t *p_input,
                        bool b_locked )
 {
     playlist_item_t *p_item;
-    if( p_playlist->b_die ) return VLC_EGENERIC;
+    /* FIXME: use b_killed instead: */
+    if( !vlc_object_alive(p_playlist) ) return VLC_EGENERIC;
     if( !pl_priv(p_playlist)->b_doing_ml )
         PL_DEBUG( "adding item `%s' ( %s )", p_input->psz_name,
                                              p_input->psz_uri );
@@ -493,8 +494,10 @@ playlist_item_t * playlist_NodeAddInput( playlist_t *p_playlist,
     assert( p_input );
     assert( p_parent && p_parent->i_children != -1 );
 
-    if( p_playlist->b_die )
+    /* FIXME: use b_killed instead: */
+    if( !vlc_object_alive(p_playlist) )
         return NULL;
+
     PL_LOCK_IF( !b_locked );
 
     p_item = playlist_ItemNewFromInput( p_playlist, p_input );
index 68d11a203442dbb735eb9d15aef2c0ce313e9c82..07a6b711953e4d5d5959207444f3693a5d616fa1 100644 (file)
@@ -459,7 +459,7 @@ static int LoopInput( playlist_t *p_playlist )
     if( !p_input )
         return VLC_EGENERIC;
 
-    if( ( p_sys->request.b_request || p_sys->killed ) && !p_input->b_die )
+    if( ( p_sys->request.b_request || p_sys->killed ) && vlc_object_alive(p_input) )
     {
         PL_DEBUG( "incoming request - stopping current input" );
         input_Stop( p_input, true );
@@ -490,7 +490,7 @@ static int LoopInput( playlist_t *p_playlist )
         return VLC_EGENERIC;
     }
     /* This input is dying, let it do */
-    else if( p_input->b_die )
+    else if( !vlc_object_alive(p_input) )
     {
         PL_DEBUG( "dying input" );
     }