]> git.sesse.net Git - vlc/commitdiff
modules: use vlc_object_alive()
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 5 Jul 2008 11:43:08 +0000 (14:43 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 5 Jul 2008 11:55:16 +0000 (14:55 +0300)
84 files changed:
modules/access/bda/bda.c
modules/access/dshow/dshow.cpp
modules/access/dv.c
modules/access/dvb/access.c
modules/access/dvb/en50221.c
modules/access/dvdnav.c
modules/access/http.c
modules/access/mms/mmsh.c
modules/access/mms/mmstu.c
modules/access/pvr.c
modules/access/rtmp/access.c
modules/access/v4l.c
modules/access/v4l2/v4l2.c
modules/access/vcdx/intf.c
modules/access_filter/timeshift.c
modules/access_output/bonjour.c
modules/access_output/rtmp.c
modules/access_output/udp.c
modules/audio_output/alsa.c
modules/audio_output/directx.c
modules/audio_output/hd1000a.cpp
modules/audio_output/oss.c
modules/audio_output/portaudio.c
modules/audio_output/waveout.c
modules/codec/avcodec/encoder.c
modules/codec/cmml/intf.c
modules/codec/spudec/parse.c
modules/control/gestures.c
modules/control/rc.c
modules/control/showintf.c
modules/demux/asf/asf.c
modules/demux/avi/avi.c
modules/demux/live555.cpp
modules/demux/mkv.cpp
modules/demux/nsv.c
modules/demux/nuv.c
modules/demux/ps.c
modules/demux/pva.c
modules/demux/rtp.c
modules/demux/ts.c
modules/gui/macosx/intf.m
modules/gui/macosx/voutgl.m
modules/gui/pda/pda.c
modules/gui/qnx/aout.c
modules/gui/qnx/vout.c
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp
modules/gui/skins2/src/vlcproc.cpp
modules/gui/wince/timer.cpp
modules/gui/wxwidgets/dialogs/vlm/vlm_slider_manager.cpp
modules/gui/wxwidgets/input_manager.cpp
modules/misc/logger.c
modules/misc/notify/xosd.c
modules/misc/rtsp.c
modules/misc/testsuite/test4.c
modules/services_discovery/bonjour.c
modules/services_discovery/hal.c
modules/services_discovery/podcast.c
modules/services_discovery/upnp_cc.cpp
modules/services_discovery/upnp_intel.cpp
modules/stream_out/rtp.c
modules/stream_out/transcode.c
modules/video_filter/atmo/AtmoExternalCaptureInput.cpp
modules/video_filter/atmo/atmo.cpp
modules/video_filter/clone.c
modules/video_filter/crop.c
modules/video_filter/deinterlace.c
modules/video_filter/logo.c
modules/video_filter/magnify.c
modules/video_filter/opencv_wrapper.c
modules/video_filter/panoramix.c
modules/video_filter/puzzle.c
modules/video_filter/remoteosd.c
modules/video_filter/transform.c
modules/video_filter/wall.c
modules/video_output/msw/direct3d.c
modules/video_output/msw/directx.c
modules/video_output/msw/events.c
modules/video_output/msw/glwin32.c
modules/video_output/msw/wingdi.c
modules/video_output/qte/qte.cpp
modules/visualization/galaktos/plugin.c
modules/visualization/goom.c
modules/visualization/visual/visual.c

index 32958518d0f1160b28b64f61cd00a515e0f9480c..de76a3850fe547d410a791ded958abf9a01e8203 100644 (file)
@@ -548,7 +548,7 @@ static block_t *Block( access_t *p_access )
     block_t *p_block;
     long l_buffer_len;
 
-    if( p_access->b_die )
+    if( !vlc_object_alive (p_access) )
         return NULL;
 
     l_buffer_len = dvb_GetBufferSize( p_access );
index a483aec75f5f9a2362d5d9bf9f729f1a230825fb..477396e8e2886299a3bc48f364ddd6fe1cd8c008 100644 (file)
@@ -1639,7 +1639,7 @@ static block_t *ReadCompressed( access_t *p_access )
 
     while( 1 )
     {
-        if( p_access->b_die || p_access->b_error ) return 0;
+        if( !vlc_object_alive (p_access) || p_access->b_error ) return 0;
 
         /* Get new sample/frame from the elementary stream (blocking). */
         vlc_mutex_lock( &p_sys->lock );
index 8962de4217f1d7f7735ad00691fc919b0f23e7af..ddd725f5fab36d94f5d3575552a460d25e8482ea 100644 (file)
@@ -368,7 +368,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
 
     vlc_thread_ready( p_this );
 
-    while( !p_sys->p_ev->b_die )
+    while( vlc_object_alive (p_sys->p_ev) )
     {
         while( ( result = poll( &(p_sys->raw1394_poll), 1, 200 ) ) < 0 )
         {
@@ -380,7 +380,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
             if( p_sys->p_ev->b_die )
                 break;
         }
-        if( p_sys->p_ev->b_die )
+        if( !vlc_object_alive (p_sys->p_ev) )
                 break;
         if( result > 0 && ( ( p_sys->raw1394_poll.revents & POLLIN )
                 || ( p_sys->raw1394_poll.revents & POLLPRI ) ) )
index 690072c5c1a774d2ab27559b665d7f82dafbeccb..0743147aa0aa711f704a162e91ae204704a68f5d 100644 (file)
@@ -430,7 +430,7 @@ static block_t *Block( access_t *p_access )
         /* Find if some data is available */
         i_ret = poll( ufds, 2, 500 );
 
-        if ( p_access->b_die )
+        if ( !vlc_object_alive (p_access) )
             return NULL;
 
         if ( i_ret < 0 )
index d8da6461af150d3b2539960f0faba23cf8c900fd..093219a0c917410c6b3ce97ab3113858cf7e385b 100644 (file)
@@ -1910,7 +1910,7 @@ int en50221_Init( access_t * p_access )
 #if HLCI_WAIT_CAM_READY
         while( ca_msg.msg[8] == 0xff && ca_msg.msg[9] == 0xff )
         {
-            if( p_access->b_die ) return VLC_EGENERIC;
+            if( !vlc_object_alive (p_access) ) return VLC_EGENERIC;
             msleep(1);
             msg_Dbg( p_access, "CAM: please wait" );
             APDUSend( p_access, 1, AOT_APPLICATION_INFO_ENQ, NULL, 0 );
index be204f7249b20a3a2f5b79855d3c550e595d58fe..43f0c1112ad6a7e5431cf6b360e506e263cd6ec6 100644 (file)
@@ -1234,7 +1234,7 @@ static int EventThread( vlc_object_t *p_this )
     var_AddCallback( p_ev->p_libvlc, "key-action", EventKey, p_ev );
 
     /* main loop */
-    while( !p_ev->b_die )
+    while( vlc_object_alive (p_ev) )
     {
         bool b_activated = false;
 
@@ -1297,7 +1297,7 @@ static int EventThread( vlc_object_t *p_this )
             p_ev->b_clicked = false;
             vlc_mutex_unlock( &p_ev->lock );
         }
-        if( p_vout && p_vout->b_die )
+        if( p_vout && !vlc_object_alive (p_vout) )
         {
             var_DelCallback( p_vout, "mouse-moved", EventMouse, p_ev );
             var_DelCallback( p_vout, "mouse-clicked", EventMouse, p_ev );
index 87bd3a183544f14fd425e67c91df29195fec6bbd..f66ffb95216b80be3488c0b1634448ed0ff21e49 100644 (file)
@@ -415,7 +415,7 @@ connect:
             p_sys->i_version = 0;
             p_sys->b_seekable = false;
 
-            if( p_access->b_die || Connect( p_access, 0 ) )
+            if( !vlc_object_alive (p_access) || Connect( p_access, 0 ) )
                 goto error;
 
 #ifndef NDEBUG
@@ -1079,7 +1079,7 @@ static int Connect( access_t *p_access, int64_t i_tell )
 
                 free( psz );
 
-                if( p_access->b_die || p_access->b_error )
+                if( !vlc_object_alive (p_access) || p_access->b_error )
                 {
                     Disconnect( p_access );
                     return -1;
@@ -1265,7 +1265,7 @@ static int Request( access_t *p_access, int64_t i_tell )
             goto error;
         }
 
-        if( p_access->b_die || p_access->b_error )
+        if( !vlc_object_alive (p_access) || p_access->b_error )
         {
             free( psz );
             goto error;
index 44a98edd645852f8dfcc7ff7055e816f7443e7eb..87528e43bae11d4a333f50bc9dee632dd1a2a77c 100644 (file)
@@ -326,7 +326,7 @@ static int Seek( access_t *p_access, int64_t i_pos )
     Stop( p_access );
     Start( p_access, i_packet * p_sys->asfh.i_min_data_packet_size );
 
-    while( !p_access->b_die )
+    while( vlc_object_alive (p_access) )
     {
         msg_Warn( p_access, "GetPacket 1" );
         if( GetPacket( p_access, &ck ) )
index 391744e96151ee592c223bf720c02d6a35a0ee16..69beb8f45b6eb25e21413cac537c5d6138c47944 100644 (file)
@@ -389,7 +389,7 @@ static int Seek( access_t * p_access, int64_t i_pos )
     var_buffer_free( &buffer );
 
 
-    while( !p_access->b_die )
+    while( vlc_object_alive (p_access) )
     {
         if( mms_HeaderMediaRead( p_access, MMS_PACKET_CMD ) < 0 )
         {
@@ -404,7 +404,7 @@ static int Seek( access_t * p_access, int64_t i_pos )
         }
     }
 
-    while( !p_access->b_die )
+    while( vlc_object_alive (p_access) )
     {
         if( mms_HeaderMediaRead( p_access, MMS_PACKET_CMD ) < 0 )
         {
@@ -1116,7 +1116,7 @@ static int NetFillBuffer( access_t *p_access )
             return -1;
         }
 
-        if( p_access->b_die || p_access->b_error ) return -1;
+        if( !vlc_object_alive (p_access) || p_access->b_error ) return -1;
 
         //msg_Dbg( p_access, "NetFillBuffer: trying again (select)" );
 
@@ -1552,7 +1552,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
     {
         int i_status;
 
-        if( p_access->b_die )
+        if( !vlc_object_alive (p_access) )
             return -1;
 
         i_status = mms_ReceivePacket( p_access );
index c7e3b6edd096a1704f9936ebf53db37df7f44de3..e7d255ca435399a34df79d939671b3daf4f71ca9 100644 (file)
@@ -1083,7 +1083,7 @@ static ssize_t Read( access_t * p_access, uint8_t * p_buffer, size_t i_len )
 
     do
     {
-        if( p_access->b_die )
+        if( !vlc_object_alive (p_access) )
             return 0;
 
         ufd.revents = 0;
index e0416aebf77e1706f031a57041fed8f6edfbd767..cc580c350057dbda8f18c76c7c1a485d87c66bce 100644 (file)
@@ -311,7 +311,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
 
     while( i_len_tmp < i_len )
     {
-        if( p_sys->p_thread->result_stop || p_access->info.b_eof || p_access->b_die )
+        if( p_sys->p_thread->result_stop || p_access->info.b_eof || !vlc_object_alive (p_access) )
         {
             p_access->info.b_eof = true;
             return 0;
@@ -510,7 +510,7 @@ static void ThreadControl( vlc_object_t *p_this )
 
     rtmp_init_handler( p_thread->rtmp_handler );
 
-    while( !p_thread->b_die )
+    while( vlc_object_alive (p_thread) )
     {
         rtmp_packet = rtmp_read_net_packet( p_thread );
         if( rtmp_packet != NULL )
index 9709f0070a750903ebe7182c67e804908dfeaa13..00ccfb674059072c4b24a9c22c93c49f8e030660 100644 (file)
@@ -1440,7 +1440,7 @@ static uint8_t *GrabCapture( demux_t *p_demux )
             return NULL;
         }
 
-        if( p_demux->b_die )
+        if( !vlc_object_alive (p_demux) )
         {
             return NULL;
         }
index aa67b3633e01befa04d5e3a199cdb6c1f8b7fd2d..6b7c7e6a1318c76946818b5c216346cbd53dd566 100644 (file)
@@ -1323,7 +1323,7 @@ static ssize_t AccessRead( access_t * p_access, uint8_t * p_buffer, size_t i_len
 
     do
     {
-        if( p_access->b_die )
+        if( !vlc_object_alive (p_access) )
             return 0;
 
         ufd.revents = 0;
index 34d382b1c77224248ca12aa597b7ad551ff6c019..24527e0891755680d54d2d76030fce0fd6c355df 100644 (file)
@@ -124,7 +124,7 @@ RunIntf( intf_thread_t *p_intf )
     dbg_print( INPUT_DBG_CALL, "intf initialized" );
 
     /* Main loop */
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
       vlc_mutex_lock( &p_intf->change_lock );
 
@@ -317,7 +317,7 @@ RunIntf( intf_thread_t *p_intf )
 static int InitThread( intf_thread_t * p_intf )
 {
     /* We might need some locking here */
-    if( !p_intf->b_die )
+    if( vlc_object_alive (p_intf) )
     {
         input_thread_t * p_input;
 
index 54c79c88f37a539e0591c4e4cff60ee5cb052c4a..b01cc1c649e54e8e7e1b661edec8e9a2e57a1ec9 100644 (file)
@@ -275,7 +275,7 @@ static void Thread( access_t *p_access )
     access_t     *p_src = p_access->p_source;
     block_t      *p_block;
 
-    while( !p_access->b_die )
+    while( vlc_object_alive (p_access) )
     {
         /* Get a new block from the source */
         if( p_src->pf_block )
@@ -320,7 +320,7 @@ static void Thread( access_t *p_access )
 
         /* Read from file to fill up the fifo */
         while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
-               !p_access->b_die )
+               vlc_object_alive (p_access) )
         {
             p_block = ReadBlockFromFile( p_access );
             if( !p_block ) break;
@@ -331,12 +331,12 @@ static void Thread( access_t *p_access )
 
     msg_Dbg( p_access, "timeshift: no more input data" );
 
-    while( !p_access->b_die &&
+    while( vlc_object_alive (p_access) &&
            (p_sys->p_read_list || block_FifoSize( p_sys->p_fifo ) ) )
     {
         /* Read from file to fill up the fifo */
         while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
-               !p_access->b_die && p_sys->p_read_list )
+               vlc_object_alive (p_access) && p_sys->p_read_list )
         {
             p_block = ReadBlockFromFile( p_access );
             if( !p_block ) break;
index aab2c7051068977f0c2f4736059a635178d8e1a3..37814deb0d454ee9277a0bdef3ed4e933bd10b2f 100644 (file)
@@ -185,7 +185,7 @@ static void poll_iterate_thread( poll_thread_t *p_pt )
 {
     vlc_thread_ready( p_pt );
 
-    while( !p_pt->b_die )
+    while( vlc_object_alive (p_pt) )
         if( avahi_simple_poll_iterate( p_pt->simple_poll, 100 ) != 0 )
             break;
 }
index 29d997069bed94e2522b541eaf41a8b1dcd36d73..a26690a097cfdb9f7973ba8cf4cb02556b870e5b 100644 (file)
@@ -386,7 +386,7 @@ static void ThreadControl( vlc_object_t *p_this )
 
     rtmp_init_handler( p_thread->rtmp_handler );
 
-    while( !p_thread->b_die )
+    while( vlc_object_alive (p_thread) )
     {
         rtmp_packet = rtmp_read_net_packet( p_thread );
         if( rtmp_packet != NULL )
index a470289558c7a15b6bece583e799f6cd622cee50..14da8aa41641c5bab890bbdb7651e03d2421df08 100644 (file)
@@ -444,7 +444,7 @@ static void ThreadWrite( vlc_object_t *p_this )
     mtime_t              i_to_send = p_thread->i_group;
     int                  i_dropped_packets = 0;
 
-    while( !p_thread->b_die )
+    while( vlc_object_alive (p_thread) )
     {
         block_t *p_pk;
         mtime_t       i_date, i_sent;
index 5a2916fb47bc8978744e1006af73c1f9c92685fe..80dc2ca180b2be8bd7b30f2469098bebe35285ee 100644 (file)
@@ -764,16 +764,16 @@ static int ALSAThread( aout_instance_t * p_aout )
 
     /* Wait for the exact time to start playing (avoids resampling) */
     vlc_mutex_lock( &p_sys->lock );
-    while( !p_sys->start_date && !p_aout->b_die )
+    while( !p_sys->start_date && vlc_object_alive (p_aout) )
         vlc_cond_wait( &p_sys->wait, &p_sys->lock );
     vlc_mutex_unlock( &p_sys->lock );
 
-    if( p_aout->b_die )
+    if( !vlc_object_alive (p_aout) )
        goto cleanup;
 
     mwait( p_sys->start_date - AOUT_PTS_TOLERANCE / 4 );
 
-    while ( !p_aout->b_die )
+    while ( vlc_object_alive (p_aout) )
     {
         ALSAFill( p_aout );
     }
@@ -876,7 +876,7 @@ static void ALSAFill( aout_instance_t * p_aout )
          * (stream is suspended and waiting for an application recovery) */
         msg_Dbg( p_aout, "entering in suspend mode, trying to resume..." );
 
-        while( !p_aout->b_die && !p_aout->p_libvlc->b_die &&
+        while( vlc_object_alive (p_aout) && vlc_object_alive (p_aout->p_libvlc) &&
                ( i_snd_rc = snd_pcm_resume( p_sys->p_snd_pcm ) ) == -EAGAIN )
         {
             msleep( 1000000 );
index 787bc3c142d35f4ec1d520d415cce1ae2de0a7a0..6c7228e7dc1ae657d98e1b8c5bdac2532146a685 100644 (file)
@@ -1064,7 +1064,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
     /* Wait here until Play() is called */
     WaitForSingleObject( p_notif->event, INFINITE );
 
-    if( !p_notif->b_die )
+    if( vlc_object_alive (p_notif) )
     {
         mwait( p_notif->start_date - AOUT_PTS_TOLERANCE / 2 );
 
@@ -1089,7 +1089,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
     }
     last_time = mdate();
 
-    while( !p_notif->b_die )
+    while( vlc_object_alive (p_notif) )
     {
         long l_read, l_free_slots;
         mtime_t mtime = mdate();
index c111c2a6d12e7c8d9593f20bd717db0c0733e087..57c5bc2a1f0e27e2acb4583e89bea10330e2f439 100644 (file)
@@ -222,7 +222,7 @@ static int Thread( aout_instance_t * p_aout )
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
     PCMAudioPlayer * pPlayer = p_sys->pPlayer;
 
-    while( !p_aout->b_die )
+    while( vlc_object_alive (p_aout) )
     {
         pPlayer->WaitForBuffer();
 
index fcd3ca0ea208abc5ce2a38db892c544fb188b988..27359c74529b473557780cfc0b25c8ae7621ddfa 100644 (file)
@@ -589,7 +589,7 @@ static int OSSThread( aout_instance_t * p_aout )
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
     mtime_t next_date = 0;
 
-    while ( !p_aout->b_die )
+    while ( vlc_object_alive (p_aout) )
     {
         aout_buffer_t * p_buffer = NULL;
         int i_tmp, i_size;
@@ -646,7 +646,7 @@ static int OSSThread( aout_instance_t * p_aout )
                 }
             }
 
-            while( !p_aout->b_die && ! ( p_buffer =
+            while( vlc_object_alive (p_aout) && ! ( p_buffer =
                 aout_OutputNextBuffer( p_aout, next_date, true ) ) )
             {
                 msleep( 1000 );
index 4e382dd593641177d9fb85be78ef24137047baae..0c19f297cb90b03756617b259d5db175d6ba23f2 100644 (file)
@@ -578,7 +578,7 @@ static void PORTAUDIOThread( pa_thread_t *pa_thread )
     aout_sys_t *p_sys;
     int i_err;
 
-    while( !pa_thread->b_die )
+    while( vlc_object_alive (pa_thread) )
     {
         /* Wait for start of stream */
         vlc_mutex_lock( &pa_thread->lock_signal );
index 8ca55d83327674a38236de93483836783700bedf..bf9ac039186fd44a0fb4954c82d4906ccbb77b7e 100644 (file)
@@ -908,7 +908,7 @@ static void CALLBACK WaveOutCallback( HWAVEOUT h_waveout, UINT uMsg,
 
     if( uMsg != WOM_DONE ) return;
 
-    if( p_aout->b_die ) return;
+    if( !vlc_object_alive (p_aout) ) return;
 
     /* Find out the current latency */
     for( i = 0; i < FRAMES_NUM; i++ )
@@ -984,9 +984,9 @@ static void WaveOutThread( notification_thread_t *p_notif )
     b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
 
     // wait for first call to "play()"
-    while( !p_sys->start_date && !p_aout->b_die )
+    while( !p_sys->start_date && vlc_object_alive (p_aout) )
            WaitForSingleObject( p_sys->event, INFINITE );
-    if( p_aout->b_die )
+    if( !vlc_object_alive (p_aout) )
         return;
 
     msg_Dbg( p_aout, "will start to play in %"PRId64" us",
@@ -1003,12 +1003,12 @@ static void WaveOutThread( notification_thread_t *p_notif )
                            p_aout->output.b_starving, msg);
     next_date = mdate();
 
-    while( !p_aout->b_die )
+    while( vlc_object_alive (p_aout) )
     {
         /* Cleanup and find out the current latency */
         i_queued_frames = WaveOutClearDoneBuffers( p_sys );
 
-        if( p_aout->b_die ) return;
+        if( !vlc_object_alive (p_aout) ) return;
 
         /* Try to fill in as many frame buffers as possible */
         for( i = 0; i < FRAMES_NUM; i++ )
@@ -1084,7 +1084,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
             }
         }
 
-        if( p_aout->b_die ) return;
+        if( !vlc_object_alive (p_aout) ) return;
 
         /*
           deal with the case that the loop didn't fillup the buffer to the
index 8bac88b778be27a9b3e0b6c6e1cd1380c9e2a856..95eef57f5f4d700bf99b539005c7550f890f46c5 100644 (file)
@@ -702,16 +702,16 @@ int OpenEncoder( vlc_object_t *p_this )
  ****************************************************************************/
 static int FfmpegThread( struct thread_context_t *p_context )
 {
-    while ( !p_context->b_die && !p_context->b_error )
+    while ( vlc_object_alive (p_context) && !p_context->b_error )
     {
         vlc_mutex_lock( &p_context->lock );
-        while ( !p_context->b_work && !p_context->b_die && !p_context->b_error )
+        while ( !p_context->b_work && vlc_object_alive (p_context) && !p_context->b_error )
         {
             vlc_cond_wait( &p_context->cond, &p_context->lock );
         }
         p_context->b_work = 0;
         vlc_mutex_unlock( &p_context->lock );
-        if ( p_context->b_die || p_context->b_error )
+        if ( !vlc_object_alive (p_context) || p_context->b_error )
             break;
 
         if ( p_context->pf_func )
index ac908726e08ffeb8044a3c3691da250f37e78f63..88493303c7a6d023b03bb262ace78e35ffe64505 100644 (file)
@@ -189,10 +189,10 @@ static void RunIntf( intf_thread_t *p_intf )
 #endif
 
     /* Main loop */
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
         /* if video output is dying, disassociate ourselves from it */
-        if( p_vout && p_vout->b_die )
+        if( p_vout && !vlc_object_alive (p_vout) )
         {
             var_DelCallback( p_vout, "mouse-clicked", MouseEvent, p_intf );
             vlc_object_release( p_vout );
@@ -334,7 +334,7 @@ static int DisplayPendingAnchor( intf_thread_t *p_intf, vout_thread_t *p_vout )
 static int InitThread( intf_thread_t * p_intf )
 {
     /* We might need some locking here */
-    if( !p_intf->b_die )
+    if( vlc_object_alive (p_intf) )
     {
         input_thread_t * p_input;
         decoder_t *p_cmml_decoder;
index 1b0f7b221bf08f6e141183879070515046cc2479..aeb7c91a4f8862539a45936f6ae356a9767b534c 100644 (file)
@@ -327,7 +327,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
         }
 
         /* We need to check for quit commands here */
-        if( p_dec->b_die )
+        if( !vlc_object_alive (p_dec) )
         {
             return VLC_EGENERIC;
         }
index 282aaf6a00b32e9484f1136428311e10f8b7acdd..e7003c9abd601b0a7c5622fd05544118045cdaab 100644 (file)
@@ -420,7 +420,7 @@ static void RunIntf( intf_thread_t *p_intf )
         /*
          * video output
          */
-        if( p_intf->p_sys->p_vout && p_intf->p_sys->p_vout->b_die )
+        if( p_intf->p_sys->p_vout && !vlc_object_alive (p_intf->p_sys->p_vout) )
         {
             var_DelCallback( p_intf->p_sys->p_vout, "mouse-moved",
                              MouseEvent, p_intf );
index 5de88df58325638b45aa9aa0bbc9fca9b2341548..3f79c05827a662e7fd51d93b6a87c43120d17540 100644 (file)
@@ -517,7 +517,7 @@ static void Run( intf_thread_t *p_intf )
             /* New input has been registered */
             if( p_input )
             {
-                if( !p_input->b_dead || !p_input->b_die )
+                if( !p_input->b_dead || vlc_object_alive (p_input) )
                 {
                     char *psz_uri =
                             input_item_GetURI( input_GetItem( p_input ) );
@@ -554,7 +554,7 @@ static void Run( intf_thread_t *p_intf )
             }
         }
 
-        if( (p_input != NULL) && !p_input->b_dead && !p_input->b_die &&
+        if( (p_input != NULL) && !p_input->b_dead && vlc_object_alive (p_input) &&
             (p_playlist != NULL) )
         {
             vlc_object_lock( p_playlist );
index a9ad8ee5c7800c0b2174b60db08297d015493776..bebf0679b1f8b559b07dd466ab61ffcfe5dcfe85 100644 (file)
@@ -135,7 +135,7 @@ static void RunIntf( intf_thread_t *p_intf )
 
 
         /* Take care of the video output */
-        if( p_intf->p_sys->p_vout && p_intf->p_sys->p_vout->b_die )
+        if( p_intf->p_sys->p_vout && !vlc_object_alive (p_intf->p_sys->p_vout) )
         {
             var_DelCallback( p_intf->p_sys->p_vout, "mouse-moved",
                              MouseEvent, p_intf );
index 03e1f8f30f71865617ae4076c771df035a5904f8..3d90b8486f0d208b2de4cbe29bfe13ea80a040e5 100644 (file)
@@ -150,7 +150,7 @@ static int Demux( demux_t *p_demux )
         mtime_t i_time_begin = GetMoviePTS( p_sys );
         int i_result;
 
-        if( p_demux->b_die )
+        if( !vlc_object_alive (p_demux) )
             break;
 #if 0
         /* FIXME: returns EOF too early for some mms streams */
index 723aa0efdab38de562cf8f01d41d77a0f426cea4..42eb4cc2b7eacd82bdfd9eaa63341f35c106da3c 100644 (file)
@@ -977,7 +977,7 @@ static int Demux_Seekable( demux_t *p_demux )
                      * affect the reading speed too much. */
                     if( !(++i_loop_count % 1024) )
                     {
-                        if( p_demux->b_die ) return -1;
+                        if( !vlc_object_alive (p_demux) ) return -1;
                         msleep( 10000 );
 
                         if( !(i_loop_count % (1024 * 10)) )
@@ -1595,7 +1595,7 @@ static int AVI_StreamChunkFind( demux_t *p_demux, unsigned int i_stream )
 
     for( ;; )
     {
-        if( p_demux->b_die ) return VLC_EGENERIC;
+        if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
 
         if( AVI_PacketGetHeader( p_demux, &avi_pk ) )
         {
@@ -1615,7 +1615,7 @@ static int AVI_StreamChunkFind( demux_t *p_demux, unsigned int i_stream )
              * affect the reading speed too much. */
             if( !(++i_loop_count % 1024) )
             {
-                if( p_demux->b_die ) return VLC_EGENERIC;
+                if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
                 msleep( 10000 );
 
                 if( !(i_loop_count % (1024 * 10)) )
@@ -2098,7 +2098,7 @@ static int AVI_PacketSearch( demux_t *p_demux )
          * this code is called only on broken files). */
         if( !(++i_count % 1024) )
         {
-            if( p_demux->b_die ) return VLC_EGENERIC;
+            if( !vlc_object_alive (p_demux) ) return VLC_EGENERIC;
 
             msleep( 10000 );
             if( !(i_count % (1024 * 10)) )
@@ -2394,7 +2394,7 @@ static void AVI_IndexCreate( demux_t *p_demux )
     {
         avi_packet_t pk;
 
-        if( p_demux->b_die )
+        if( !vlc_object_alive (p_demux) )
         {
             return;
         }
index 0b3860dafcde4efdd613f234fb22fd57a69a56f9..1dd3608b342c55250da947e85d54a52b05b1a0ee 100644 (file)
@@ -323,7 +323,7 @@ static int  Open ( vlc_object_t *p_this )
             int i_read = stream_Read( p_demux->s, &p_sdp[i_sdp],
                                       i_sdp_max - i_sdp - 1 );
 
-            if( p_demux->b_die || p_demux->b_error )
+            if( !vlc_object_alive (p_demux) || p_demux->b_error )
             {
                 free( p_sdp );
                 goto error;
@@ -507,7 +507,7 @@ static int Connect( demux_t *p_demux )
     i_lefttries = 3;
 createnew:
     i_lefttries--;
-    if( p_demux->b_die || p_demux->b_error )
+    if( !vlc_object_alive (p_demux) || p_demux->b_error )
     {
         free( psz_user );
         free( psz_pwd );
@@ -669,7 +669,7 @@ static int SessionsSetup( demux_t *p_demux )
         Boolean bInit;
         live_track_t *tk;
 
-        if( p_demux->b_die || p_demux->b_error )
+        if( !vlc_object_alive (p_demux) || p_demux->b_error )
         {
             delete iter;
             return VLC_EGENERIC;
@@ -1796,7 +1796,7 @@ static void TimeoutPrevention( timeout_thread_t *p_timeout )
     vlc_thread_ready( p_timeout );
 
     /* Avoid lock */
-    while( !p_timeout->b_die )
+    while( vlc_object_alive (p_timeout) )
     {
         if( p_timeout->i_remain <= 0 )
         {
index 870142e0090a8043dd9a0ac269beb57def4d9b52..00502b11e1ceff6729fbf7f8234b93116657568c 100644 (file)
@@ -2796,7 +2796,7 @@ int demux_sys_t::EventThread( vlc_object_t *p_this )
     var_AddCallback( p_ev->p_libvlc, "key-action", EventKey, p_ev );
 
     /* main loop */
-    while( !p_ev->b_die )
+    while( vlc_object_alive (p_ev) )
     {
         if ( !p_sys->b_pci_packet_set )
         {
@@ -3054,7 +3054,7 @@ int demux_sys_t::EventThread( vlc_object_t *p_this )
         }
 
         /* VOUT part */
-        if( p_vout && p_vout->b_die )
+        if( p_vout && !vlc_object_alive (p_vout) )
         {
             var_DelCallback( p_vout, "mouse-moved", EventMouse, p_ev );
             var_DelCallback( p_vout, "mouse-clicked", EventMouse, p_ev );
index 0e35e162960834db99261dedf247f10eaa6bd1ad..19f112019e9148e4d1d0f583fd8f7425ee3b1a16 100644 (file)
@@ -387,7 +387,7 @@ static int ReSynch( demux_t *p_demux )
     int      i_skip;
     int      i_peek;
 
-    while( !p_demux->b_die )
+    while( vlc_object_alive (p_demux) )
     {
         if( ( i_peek = stream_Peek( p_demux->s, &p_peek, 1024 ) ) < 8 )
         {
index b55f3c1f19bfdf0a973fa379f47a46bd4aec69c3..97d8d44f8233b2736880c3e3fe162ddd4ec14219 100644 (file)
@@ -335,7 +335,7 @@ static int Demux( demux_t *p_demux )
 
     for( ;; )
     {
-        if( p_demux->b_die )
+        if( !vlc_object_alive (p_demux) )
             return -1;
 
         if( FrameHeaderLoad( p_demux, &fh ) )
@@ -442,7 +442,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                     return VLC_EGENERIC;
             }
 
-            while( !p_demux->b_die )
+            while( vlc_object_alive (p_demux) )
             {
                 frame_header_t fh;
                 int64_t i_tell;
@@ -482,7 +482,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
             p_sys->i_pcr = -1;
 
-            while( !p_demux->b_die )
+            while( vlc_object_alive (p_demux) )
             {
                 frame_header_t fh;
 
index 7ecf8d1b45ab88a1998780750880075406796735..bed63fea63ca9d20a766d6581bcb0ee1d658ce9c 100644 (file)
@@ -243,14 +243,14 @@ static void FindLength( demux_t *p_demux )
         /* Check beginning */
         i = 0;
         i_current_pos = stream_Tell( p_demux->s );
-        while( !p_demux->b_die && i < 40 && Demux2( p_demux, false ) > 0 ) i++;
+        while( vlc_object_alive (p_demux) && i < 40 && Demux2( p_demux, false ) > 0 ) i++;
 
         /* Check end */
         i_size = stream_Size( p_demux->s );
         i_end = __MAX( 0, __MIN( 200000, i_size ) );
         stream_Seek( p_demux->s, i_size - i_end );
 
-        while( !p_demux->b_die && Demux2( p_demux, true ) > 0 );
+        while( vlc_object_alive (p_demux) && Demux2( p_demux, true ) > 0 );
         if( i_current_pos >= 0 ) stream_Seek( p_demux->s, i_current_pos );
     }
 
index cb0d46ed3702327bae081bc4eaedf76f71f9cc4d..09eaf303e50c276e2b0df4f862c7bcd7b50bcabb 100644 (file)
@@ -344,7 +344,7 @@ static int ReSynch( demux_t *p_demux )
     int      i_skip;
     int      i_peek;
 
-    while( !p_demux->b_die )
+    while( vlc_object_alive (p_demux) )
     {
         if( ( i_peek = stream_Peek( p_demux->s, &p_peek, 1024 ) ) < 8 )
         {
index c05cb210b33562ca8562e2c9035fd65b22c579e8..58e1a1e5ef1c7e955025b4a6429f215da0be89b8 100644 (file)
@@ -372,7 +372,7 @@ static block_t *rtp_dgram_recv (demux_t *demux, int fd)
         len = net_Read (VLC_OBJECT (demux), fd, NULL,
                                 block->p_buffer, block->i_buffer, false);
         if (((len <= 0) && fd_dead (fd))
-         || demux->b_die)
+         || !vlc_object_alive (demux))
         {
             block_Release (block);
             return NULL;
index f67586f4f07deaf00fce660edd2c6edb677edc0c..f491ca59350529c84aaf6b8d2d74bae5d9f1a6cb 100644 (file)
@@ -941,13 +941,13 @@ static int DemuxFile( demux_t *p_demux )
         if( p_sys->buffer[i_pos] != 0x47 )
         {
             msg_Warn( p_demux, "lost sync" );
-            while( !p_demux->b_die && (i_pos < i_data) )
+            while( vlc_object_alive (p_demux) && (i_pos < i_data) )
             {
                 i_pos++;
                 if( p_sys->buffer[i_pos] == 0x47 )
                     break;
             }
-            if( !p_demux->b_die )
+            if( vlc_object_alive (p_demux) )
                 msg_Warn( p_demux, "sync found" );
         }
 
@@ -1052,7 +1052,7 @@ static int Demux( demux_t *p_demux )
             msg_Warn( p_demux, "lost synchro" );
             block_Release( p_pkt );
 
-            while( !p_demux->b_die )
+            while( vlc_object_alive (p_demux) )
             {
                 const uint8_t *p_peek;
                 int i_peek, i_skip = 0;
index 62a63fe212cb60f7d61cc7c3707d1467efcdfc75..c0c86f4c3fa3075edf1892afc2d17d3056612460 100644 (file)
@@ -1173,7 +1173,7 @@ static VLCMain *_o_sharedMainInstance = nil;
                 p_intf->p_sys->b_input_update = true;
             }
         }
-        else if( p_intf->p_sys->p_input->b_die || p_intf->p_sys->p_input->b_dead )
+        else if( !vlc_object_alive (p_intf->p_sys->p_input) || p_intf->p_sys->p_input->b_dead )
         {
             /* input stopped */
             p_intf->p_sys->b_intf_update = true;
@@ -1294,7 +1294,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     p_input = vlc_object_find( p_playlist, VLC_OBJECT_INPUT,
                                FIND_CHILD );
 
-    if( p_input && !p_input->b_die )
+    if( p_input && vlc_object_alive (p_input) )
     {
         vlc_value_t val;
 
@@ -1513,7 +1513,7 @@ end:
     input_thread_t * p_input = p_playlist->p_input;
 
     i_end_scroll = -1;
-    if( p_input && !p_input->b_die )
+    if( p_input && vlc_object_alive (p_input) )
     {
         NSString *o_temp;
         vlc_object_yield( p_input );
index 58817becf6029fbc791068fa260586fd17ba35dc..cfcdaf0393f5e6a8bc42e074e67247cde3baee97 100644 (file)
@@ -204,7 +204,7 @@ void CloseVideoGL ( vlc_object_t * p_this )
     {
         aglDestroyContext(p_vout->p_sys->agl_ctx);
     }
-    else if(VLCIntf && !VLCIntf->b_die)
+    else if(VLCIntf && vlc_object_alive (VLCIntf))
     {
         NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
 
index 61170306dad5be3e8c3781dc0ea01897a7a21e37..7b35818ccd01a564ec29f8f76bc1c7fa634c6754 100644 (file)
@@ -418,7 +418,7 @@ static int Manage( intf_thread_t *p_intf )
         int64_t i_time = 0, i_length = 0;
 
         vlc_object_lock( p_input );
-        if( !p_input->b_die )
+        if( vlc_object_alive (p_input) )
         {
             playlist_t *p_playlist;
 
index 33accf21bb0a4a50be8eb9ee77eac90af678df4d..3f86707bb2ed144a49f8fb79f4a72d0293f8e7e5 100644 (file)
@@ -265,7 +265,7 @@ static int QNXaoutThread( aout_instance_t * p_aout )
 {
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
 
-    while ( !p_aout->b_die )
+    while ( vlc_object_alive (p_aout) )
     {
         aout_buffer_t * p_buffer;
         int i_tmp, i_size;
index bbb0a1cf7720c5778814e5c71943b6a045c632ba..98a07654df0e19307f533a17cc4f54f27b9cd99b 100644 (file)
@@ -301,7 +301,7 @@ static int QNXManage( vout_thread_t *p_vout )
     PhEvent_t *p_event;
     bool b_repos = 0;
 
-    if (p_vout->b_die)
+    if (!vlc_object_alive (p_vout))
     {
         return ( 0 );
     }
index 936aeb92b48d9083d28ae3e243830909cf9f15b9..2dfcf8d732e50e7ff0dcbd6722f3ff2b17de06f7 100644 (file)
@@ -78,7 +78,7 @@ void InputManager::setInput( input_thread_t *_p_input )
 {
     delInput();
     p_input = _p_input;
-    if( p_input && !( p_input->b_dead || p_input->b_die ) )
+    if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )
     {
         vlc_object_yield( p_input );
         emit statusChanged( PLAYING_S );
@@ -560,7 +560,7 @@ void MainInputManager::customEvent( QEvent *event )
     if( VLC_OBJECT_INTF == p_intf->i_object_type ) /* FIXME: don't use object type */
     {
         vlc_mutex_lock( &p_intf->change_lock );
-        if( p_input && ( p_input->b_dead || p_input->b_die ) )
+        if( p_input && ( p_input->b_dead || !vlc_object_alive (p_input) ) )
         {
             var_DelCallback( p_input, "state", PLItemChanged, this );
             vlc_object_release( p_input );
@@ -574,7 +574,7 @@ void MainInputManager::customEvent( QEvent *event )
         {
             QPL_LOCK;
             p_input = THEPL->p_input;
-            if( p_input && !( p_input->b_die || p_input->b_dead) )
+            if( p_input && !( !vlc_object_alive (p_input) || p_input->b_dead) )
             {
                 vlc_object_yield( p_input );
                 var_AddCallback( p_input, "state", PLItemChanged, this );
index 7a120ce76e5e572eb959e59dbd392cb180241a2f..0efe7ec058db329742f6f4ac0a182143cd65cbff 100644 (file)
@@ -66,7 +66,7 @@ public:
     virtual ~InputManager();
 
     void delInput();
-    bool hasInput() { return p_input && !p_input->b_dead && !p_input->b_die; }
+    bool hasInput() { return p_input && !p_input->b_dead && vlc_object_alive (p_input); }
     bool hasAudio();
     bool hasVideo();
 
index bf2ef4f681e69601a81dc9012274d82087ffc720..9dddff289e9ef664aea64c14c7e2db85a99140d2 100644 (file)
@@ -339,7 +339,7 @@ void VlcProc::refreshInput()
     }
 
 
-    if( pInput && !pInput->b_die )
+    if( pInput && vlc_object_alive (pInput) )
     {
         // Refresh time variables
         vlc_value_t pos;
index ea5425e48f8013ad6d2cdd687d563c22f1e6cbe0..5047f0cc4e9835be9cfdbb06313e70ca5ebcf66b 100644 (file)
@@ -142,7 +142,7 @@ void Timer::Notify( void )
     {
         input_thread_t *p_input = p_intf->p_sys->p_input;
 
-        if( !p_input->b_die )
+        if( vlc_object_alive (p_input) )
         {
             /* New input or stream map change */
             p_intf->p_sys->b_playing = 1;
index e67fd5f31692990b1d95fa023413c4be44e79e76..ad5ee7470621454173779dcd5f504d79a1b6f2bb 100644 (file)
@@ -74,7 +74,7 @@ void VLMSliderManager::Update()
         p_input = NULL;
     }
 
-    if( p_input && !p_input->b_die )
+    if( p_input && vlc_object_alive (p_input) )
     {
         vlc_value_t pos;
 
index 9419e2ef07e74d20b21ed4076b515ee8741ce60d..8663051c546da3cf8b48d4dc7a4b5ed82278fe9b 100644 (file)
@@ -186,7 +186,7 @@ InputManager::~InputManager()
  *****************************************************************************/
 bool InputManager::IsPlaying()
 {
-    return (p_input && !p_input->b_die);
+    return (p_input && vlc_object_alive (p_input));
 }
 
 /*****************************************************************************
@@ -372,7 +372,7 @@ void InputManager::Update()
         i_input_hide_delay = 0;
     }
 
-    if( p_input && !p_input->b_die )
+    if( p_input && vlc_object_alive (p_input) )
     {
         vlc_value_t pos, len;
 
index 360a04e2f57ce24fa8184a6d0b09daa02306ad7c..7e92e97c2e002701911b3fc2727f509e024bd274 100644 (file)
@@ -320,7 +320,7 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
         FlushQueue( p_intf->p_sys->p_sub, p_intf->p_sys->p_file,
                     p_intf->p_sys->i_mode,
index bf9994d176d96e72e88df7ee492a45d5dec64d3a..9ba256a80fd021a7f9e041f19cb3b3cf86efb0b8 100644 (file)
@@ -211,7 +211,7 @@ static void Run( intf_thread_t *p_intf )
     char psz_duration[MSTRTIME_MAX_SIZE+2];
     char *psz_display = NULL;
 
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
         if( p_intf->p_sys->b_need_update == true )
         {
index ae7e27754ca80d9f696871d82b9dae1048624f8b..ff41506314f052e3b05bc4eed7cdd85a85346a4a 100644 (file)
@@ -798,7 +798,7 @@ static void CommandThread( vlc_object_t *p_this )
     vod_t *p_vod = (vod_t*)p_this;
     vod_sys_t *p_sys = p_vod->p_sys;
 
-    while( !p_vod->b_die )
+    while( vlc_object_alive (p_vod) )
     {
         block_t *p_block_cmd = block_FifoGet( p_sys->p_fifo_cmd );
         rtsp_cmd_t cmd;
index f07a6a13ad0bf39af4d3509aac7cbfcd4f821ba0..7ce10159a5b7cc35dd8657306484223b02d55bec 100644 (file)
@@ -236,7 +236,7 @@ static void * MyThread( vlc_object_t *p_this )
 
     val.i_int = 42;
 
-    while( !p_this->b_die )
+    while( vlc_object_alive (p_this) )
     {
         int i = (int) (100.0 * rand() / (RAND_MAX));
 
@@ -422,7 +422,7 @@ static void * Dummy( vlc_object_t *p_this )
 
     vlc_thread_ready( p_this );
 
-    while( !p_this->b_die )
+    while( vlc_object_alive (p_this) )
     {
         msleep( 10000 );
     }
index e6d06fcbbc9b0701198098e2d4ff513292d2d39f..f30c0e2f2543e6408a49c4c7cc7ef7d839791121 100644 (file)
@@ -354,7 +354,7 @@ static void Run( services_discovery_t *p_sd )
 {
     services_discovery_sys_t *p_sys = p_sd->p_sys;
 
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         if( avahi_simple_poll_iterate( p_sys->simple_poll, 100 ) != 0 )
         {
index a6837d51e91ea13994a261fd24fbc5d83189dc44..fbc3ea65ec868593583ce09d126c971d2b5aa258 100644 (file)
@@ -310,7 +310,7 @@ static void Run( services_discovery_t *p_sd )
             libhal_free_string( devices[ i ] );
         }
     }
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         /* look for events on the bus, blocking 1 second */
         dbus_connection_read_write_dispatch( p_sys->p_connection, 1000 );
index 63993e904b091262ddb7687604b7fa6096a725b8..8d732703d6741958e2128e9c9d6014f1d658d795 100644 (file)
@@ -159,7 +159,7 @@ static void Run( services_discovery_t *p_sd )
     free( psz_urls ); /* Gruik ? */
     var_AddCallback( p_sd, "podcast-urls", UrlsChange, p_sys );
 
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         int i;
         if( p_sys->b_update == true )
index b4d1757ddb3ed563b488f3106432191d93e153d4..91bec309b29de85bf476278a1a47c17014987484 100644 (file)
@@ -156,7 +156,7 @@ static void Run( services_discovery_t *p_sd )
 
     msg_Dbg( p_sd, "UPnP discovery started" );
     /* read SAP packets */
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         msleep( 500 );
     }
index b8db719b8b44874c440e19d64dac1b3f85fc711d..d269e04c3492624c6ec9cc5710ad384a507376fa 100644 (file)
@@ -347,7 +347,7 @@ static void Run( services_discovery_t* p_sd )
     }
 
     msg_Dbg( p_sd, "UPnP discovery started" );
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         msleep( 500 );
     }
index 61b4d3ab5a69a1b6371d0f6dc5eb17f2ea624758..032472aa55be4df8f6e819af0394df5ac0821289 100644 (file)
@@ -1433,7 +1433,7 @@ static void ThreadSend( vlc_object_t *p_this )
     sout_stream_id_t *id = (sout_stream_id_t *)p_this;
     unsigned i_caching = id->i_caching;
 
-    while( !id->b_die )
+    while( vlc_object_alive (id) )
     {
         block_t *out = block_FifoGet( id->p_fifo );
         if( out == NULL )
index 695b433815c5f8a7486ef365e4c491d97352c9e0..2662e6c4da2a8d267c91593661a9d2e8f1ff3cc6 100644 (file)
@@ -2080,7 +2080,7 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
     sout_stream_id_t *id = p_sys->id_video;
     picture_t *p_pic;
 
-    while( !p_sys->b_die && !p_sys->b_error )
+    while( vlc_object_alive (p_sys) && !p_sys->b_error )
     {
         block_t *p_block;
 
@@ -2088,9 +2088,9 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
         while( p_sys->i_last_pic == p_sys->i_first_pic )
         {
             vlc_cond_wait( &p_sys->cond, &p_sys->lock_out );
-            if( p_sys->b_die || p_sys->b_error ) break;
+            if( !vlc_object_alive (p_sys) || p_sys->b_error ) break;
         }
-        if( p_sys->b_die || p_sys->b_error )
+        if( !vlc_object_alive (p_sys) || p_sys->b_error )
         {
             vlc_mutex_unlock( &p_sys->lock_out );
             break;
index f61943874a53a04136e7e54212f942d5295bd036..535cc95baeb3d7d4b39dc8035329e657b850f5cd 100644 (file)
@@ -126,7 +126,7 @@ DWORD CAtmoExternalCaptureInput::Execute(void)
 
     vlc_mutex_lock( &m_WakeupLock );
 
-    while ((this->m_bTerminated == ATMO_FALSE) && (this->m_pAtmoThread->b_die == false)) {
+    while ((this->m_bTerminated == ATMO_FALSE) && (!vlc_object_alive (this->m_pAtmoThread) == false)) {
           int value = vlc_cond_timedwait(&m_WakeupCond, &m_WakeupLock, mdate() + INT64_C(75000));
           if(!value) {
              /* DeliverNewSourceDataPaket delivered new work for me... get it! */
index 238131297778151d9cb69e6fdd407fd1e6cc82e1..ca4ea9bed145028f703883b710cc1f3d32cffa92 100644 (file)
@@ -1761,7 +1761,7 @@ static void FadeToColorThread(fadethread_t *p_fadethread)
             /* send the same pixel data again... to unlock the buffer! */
             AtmoSendPixelData( p_fadethread->p_filter );
 
-            while( (!p_fadethread->b_die) &&
+            while( (vlc_object_alive (p_fadethread)) &&
                 (i_steps_done < p_fadethread->i_steps))
             {
                 p_transfer = AtmoLockTransferBuffer( p_fadethread->p_filter );
@@ -1774,7 +1774,7 @@ static void FadeToColorThread(fadethread_t *p_fadethread)
                 thread improvements wellcome!
                 */
                 for(i_index = 0;
-                    (i_index < i_size) && (!p_fadethread->b_die);
+                    (i_index < i_size) && (vlc_object_alive (p_fadethread));
                     i_index+=4)
                 {
                     i_src_blue  = p_source[i_index+0];
@@ -1802,13 +1802,13 @@ static void FadeToColorThread(fadethread_t *p_fadethread)
                 the VLC libaries? inside native win32 I would use an Event
                 (CreateEvent) and here an WaitForSingleObject?
                 */
-                if(p_fadethread->b_die) break;
+                if(!vlc_object_alive (p_fadethread)) break;
                 msleep(10000);
-                if(p_fadethread->b_die) break;
+                if(!vlc_object_alive (p_fadethread)) break;
                 msleep(10000);
-                if(p_fadethread->b_die) break;
+                if(!vlc_object_alive (p_fadethread)) break;
                 msleep(10000);
-                if(p_fadethread->b_die) break;
+                if(!vlc_object_alive (p_fadethread)) break;
                 msleep(10000);
             }
             free(p_source);
index b6d48320544b72263db46a90890b117fbd47e93a..3b558d3b1825731414f3fe57200a6bac419e8970 100644 (file)
@@ -328,7 +328,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
             vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ], 0, 0, 0 )
                ) == NULL )
         {
-            if( p_vout->b_die || p_vout->b_error )
+            if( !vlc_object_alive (p_vout) || p_vout->b_error )
             {
                 vout_DestroyPicture(
                     p_vout->p_sys->pp_vout[ i_vout ], p_outpic );
index cb5fd1d525b6c76dba60df7f114d500958bff0da..e477c5c337d49d2a65591012b43427050a7c519a 100644 (file)
@@ -501,7 +501,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
                  vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 )
            ) == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             vout_DestroyPicture( p_vout->p_sys->p_vout, p_outpic );
             return;
index 256462d24a9a1f55fb836dfa387dadba448ad093..26b8f0bfb3f832d2168cb50a20c6f519f917a08d 100644 (file)
@@ -486,7 +486,7 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
                                                 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             vlc_mutex_unlock( &p_vout->p_sys->filter_lock );
             return;
@@ -503,7 +503,7 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
                                                  0, 0, 0 ) )
                   == NULL )
         {
-            if( p_vout->b_die || p_vout->b_error )
+            if( !vlc_object_alive (p_vout) || p_vout->b_error )
             {
                 vout_DestroyPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
                 vlc_mutex_unlock( &p_vout->p_sys->filter_lock );
index 7cbd77642bdbdc6237cf22bb949ab2e194bddf91..c6db247c9f0989b22eadaa64dd3f2f16e7f48a72 100644 (file)
@@ -576,7 +576,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
     /* This is a new frame. Get a structure from the video_output. */
     while( !(p_outpic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 )) )
     {
-        if( p_vout->b_die || p_vout->b_error ) return;
+        if( !vlc_object_alive (p_vout) || p_vout->b_error ) return;
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
index 4c78bbb50db712c9bd358f8aa4bd43f4dae461a2..6b38557eb1ef63f1b1f6b99ddd83050490324bdc 100644 (file)
@@ -241,7 +241,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     while( ( p_outpic = vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             return;
         }
index 95b4607332410820201f971408574b4004454e03..24f1be84067548b44874bc431189aa9587c85b3b 100644 (file)
@@ -555,7 +555,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     while( ( p_outpic = vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {   return; }
         msleep( VOUT_OUTMEM_SLEEP );
     }
index 9ba8c9d18fc204dc45ac3def80d9d7c2a9788449..91a067ff603763fa9aa26ec4cb4e918c3b1e45d7 100644 (file)
@@ -964,7 +964,7 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
@@ -1308,7 +1308,7 @@ static void RenderPackedRGB( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
@@ -1646,7 +1646,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
index 5f4fc1882ee3e8545aedf76f986a654ba84b837a..3d62c771d77305b1a48be7b695fc3c055acad54c 100644 (file)
@@ -362,7 +362,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     while( ( p_outpic = vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             return;
         }
index ab76504c2eee5baf31724645f25069bc8c64e1a9..b7fbc78ccd5633883964c98cc926298cdec3c9a9 100644 (file)
@@ -809,7 +809,7 @@ static void vnc_worker_thread( vlc_object_t *p_thread_obj )
 
        }
 
-       if (p_sys->p_worker_thread->b_die ||
+       if (!vlc_object_alive (p_sys->p_worker_thread) ||
            p_sys->p_worker_thread->b_error)
        {
            p_sys->b_continue = false;
@@ -857,7 +857,7 @@ static void update_request_thread( vlc_object_t *p_thread_obj )
                 msg_Err( p_filter, "Could not write rfbFramebufferUpdateRequestMsg." );
                 p_sys->b_continue = false;
             }
-            if (p_sys->p_update_request_thread->b_die ||
+            if (!vlc_object_alive (p_sys->p_update_request_thread) ||
                 p_sys->p_update_request_thread->b_error)
             {
                 p_sys->b_continue = false;
index 3f5f0ec7d8ad4c0eb183a2c70e7300ddce00c333..dc880d2efc4d26464e9084986002ca1f13b81ce1 100644 (file)
@@ -320,7 +320,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     while( ( p_outpic = vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             return;
         }
index 3643755e5aa4a8967e4c165f97a0f342916b4823..c5833bc67f85a39aae0ff29a7c24d48440f40a5a 100644 (file)
@@ -512,7 +512,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
index 829882062ca161623ccf415736f57e370c503600..7f771d0a4fea81883c69601e88d6c672f4c1e803 100644 (file)
@@ -528,7 +528,7 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /* Check if the event thread is still running */
-    if( p_vout->p_sys->p_event->b_die )
+    if( !vlc_object_alive (p_vout->p_sys->p_event) )
     {
         return VLC_EGENERIC; /* exit */
     }
index cd8ed738c6450cde3a6bd868830b5db81172ee6e..aab3e883c725e34ccf0bee7f4be9798c4b9a5926 100644 (file)
@@ -691,7 +691,7 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /* Check if the event thread is still running */
-    if( p_vout->p_sys->p_event->b_die )
+    if( !vlc_object_alive (p_vout->p_sys->p_event) )
     {
         return VLC_EGENERIC; /* exit */
     }
index 84dae385754493737a8c50102a503495aa660243..486791722e735ffd8a89c43b15aef06e2915da1e 100644 (file)
@@ -131,10 +131,10 @@ void EventThread( event_thread_t *p_event )
 
     /* Main loop */
     /* GetMessage will sleep if there's no message in the queue */
-    while( !p_event->b_die && GetMessage( &msg, 0, 0, 0 ) )
+    while( vlc_object_alive (p_event) && GetMessage( &msg, 0, 0, 0 ) )
     {
         /* Check if we are asked to exit */
-        if( p_event->b_die )
+        if( !vlc_object_alive (p_event) )
             break;
 
         switch( msg.message )
index 6cd20ceb0f5fc943342a56390a0b1b145ce99307..9a4fc8738dde3d8b9be45471679d1c8d6ce49c5e 100644 (file)
@@ -390,7 +390,7 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /* Check if the event thread is still running */
-    if( p_vout->p_sys->p_event->b_die )
+    if( !vlc_object_alive (p_vout->p_sys->p_event) )
     {
         return VLC_EGENERIC; /* exit */
     }
index 1dbd8992973305fbed261a96c4ee6ce4e92907de..4b5ccb827eba83ecd757932f018cea672659a4ac 100755 (executable)
@@ -621,7 +621,7 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /* Check if the event thread is still running */
-    if( p_vout->p_sys->p_event->b_die )
+    if( !vlc_object_alive (p_vout->p_sys->p_event) )
     {
         return VLC_EGENERIC; /* exit */
     }
index 11316fbdfb312aada33b7eb29230bd33d98cde68..d55fe342106a2a34cf23fb434f5b36749831bc85 100644 (file)
@@ -396,7 +396,7 @@ static int Manage( vout_thread_t *p_vout )
 //        SDL_ShowCursor( 0 );
 //    }
 //
-//    if( p_vout->p_libvlc->b_die )
+//    if( !vlc_object_alive (p_vout->p_libvlc) )
 //        p_vout->p_sys->bRunning = FALSE;
 
     return 0;
@@ -641,10 +641,10 @@ static void RunQtThread(event_thread_t *p_event)
         p_event->p_vout->p_sys->bRunning = TRUE;
 
 #ifdef NEED_QTE_MAIN
-        while(!p_event->b_die && p_event->p_vout->p_sys->bRunning)
+        while(vlc_object_alive (p_event) && p_event->p_vout->p_sys->bRunning)
               {
                /* Check if we are asked to exit */
-           if( p_event->b_die )
+           if( !vlc_object_alive (p_event) )
                break;
 
                msleep(100);
index 7d82a45a5b08740af613407159d3da90c147bfec..3808bbada4478dedf38922fd24d8533bcded9ac6 100644 (file)
@@ -241,7 +241,7 @@ static void Thread( vlc_object_t *p_this )
 
     timestart=mdate()/1000;
 
-    while( !p_thread->b_die )
+    while( vlc_object_alive (p_thread) )
     {
         mspf = 1000 / 60;
         if( galaktos_update( p_thread ) == 1 )
index 9382b80494bda39540c4ad08c996bd466fb3b8bf..0fb03910fc0453b8072473a4f26c972cee7698ff 100644 (file)
@@ -336,7 +336,7 @@ static void Thread( vlc_object_t *p_this )
 
     p_plugin_info = goom_init( width.i_int, height.i_int );
 
-    while( !p_thread->b_die )
+    while( vlc_object_alive (p_thread) )
     {
         uint32_t  *plane;
         picture_t *p_pic;
@@ -361,7 +361,7 @@ static void Thread( vlc_object_t *p_this )
         p_thread->psz_title = NULL;
 
         while( !( p_pic = vout_CreatePicture( p_thread->p_vout, 0, 0, 0 ) ) &&
-               !p_thread->b_die )
+               vlc_object_alive (p_thread) )
         {
             msleep( VOUT_OUTMEM_SLEEP );
         }
index 836925ee343c1dc760e50619f7398edc97f3a84b..2a265f8c1b9756e60fb2a57ac42756327c0e01e0 100644 (file)
@@ -351,7 +351,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
     /* First, get a new picture */
     while( ( p_outpic = vout_CreatePicture( p_sys->p_vout, 0, 0, 3 ) ) == NULL)
     {
-        if( p_aout->b_die )
+        if( !vlc_object_alive (p_aout) )
         {
             return;
         }