]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/encoder.c
modules: use vlc_object_alive()
[vlc] / modules / codec / avcodec / encoder.c
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 )