Fix locking issues in (embedded) snapshot code
authorOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Tue, 17 Jul 2007 13:12:55 +0000 (13:12 +0000)
committerOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Tue, 17 Jul 2007 13:12:55 +0000 (13:12 +0000)
src/control/mediacontrol_audio_video.c
src/video_output/vout_intf.c

index 212dc27..0ff7c31 100644 (file)
@@ -84,6 +84,7 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
     vlc_object_release( p_vout );
 
     p_snapshot = ( snapshot_t* ) p_cache->p_private;
+    vlc_mutex_unlock( &p_cache->object_lock );
     vlc_object_destroy( p_cache );
 
     if( p_snapshot )
index 8680359..3239a9e 100644 (file)
@@ -524,7 +524,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             msg_Err( p_vout, "Could not get snapshot" );
             image_HandlerDelete( p_image );
             vlc_cond_signal( &p_dest->object_wait );
-            vlc_mutex_unlock( &p_dest->object_lock );
             vlc_object_release( p_dest );
             return VLC_EGENERIC;
         }
@@ -537,7 +536,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             block_Release( p_block );
             image_HandlerDelete( p_image );
             vlc_cond_signal( &p_dest->object_wait );
-            vlc_mutex_unlock( &p_dest->object_lock );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -555,7 +553,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             free( p_snapshot );
             image_HandlerDelete( p_image );
             vlc_cond_signal( &p_dest->object_wait );
-            vlc_mutex_unlock( &p_dest->object_lock );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -567,7 +564,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
 
         /* Unlock the object */
         vlc_cond_signal( &p_dest->object_wait );
-        vlc_mutex_unlock( &p_dest->object_lock );
         vlc_object_release( p_dest );
 
         image_HandlerDelete( p_image );