Commit 7b721c86 authored by Olivier Aubert's avatar Olivier Aubert

embedded snapshot: properly lock/unlock the cache object

parent a721dbaf
...@@ -94,7 +94,6 @@ mediacontrol_snapshot( mediacontrol_Instance *self, ...@@ -94,7 +94,6 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
vlc_object_release( p_vout ); vlc_object_release( p_vout );
p_snapshot = ( snapshot_t* ) p_cache->p_private; p_snapshot = ( snapshot_t* ) p_cache->p_private;
vlc_object_unlock( p_cache );
vlc_object_release( p_cache ); vlc_object_release( p_cache );
vlc_object_release( p_input ); vlc_object_release( p_input );
......
...@@ -639,8 +639,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -639,8 +639,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
snapshot_t *p_snapshot; snapshot_t *p_snapshot;
size_t i_size; size_t i_size;
/* Object must be locked. We will unlock it once we get the vlc_object_lock( p_dest );
snapshot and written it to p_private */
p_dest->p_private = NULL; p_dest->p_private = NULL;
/* Save the snapshot to a memory zone */ /* Save the snapshot to a memory zone */
...@@ -650,6 +649,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -650,6 +649,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
msg_Err( p_vout, "Could not get snapshot" ); msg_Err( p_vout, "Could not get snapshot" );
image_HandlerDelete( p_image ); image_HandlerDelete( p_image );
vlc_object_signal_unlocked( p_dest ); vlc_object_signal_unlocked( p_dest );
vlc_object_unlock( p_dest );
vlc_object_release( p_dest ); vlc_object_release( p_dest );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -662,6 +662,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -662,6 +662,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
block_Release( p_block ); block_Release( p_block );
image_HandlerDelete( p_image ); image_HandlerDelete( p_image );
vlc_object_signal_unlocked( p_dest ); vlc_object_signal_unlocked( p_dest );
vlc_object_unlock( p_dest );
vlc_object_release( p_dest ); vlc_object_release( p_dest );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
...@@ -679,6 +680,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -679,6 +680,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
free( p_snapshot ); free( p_snapshot );
image_HandlerDelete( p_image ); image_HandlerDelete( p_image );
vlc_object_signal_unlocked( p_dest ); vlc_object_signal_unlocked( p_dest );
vlc_object_unlock( p_dest );
vlc_object_release( p_dest ); vlc_object_release( p_dest );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
...@@ -690,6 +692,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -690,6 +692,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
/* Unlock the object */ /* Unlock the object */
vlc_object_signal_unlocked( p_dest ); vlc_object_signal_unlocked( p_dest );
vlc_object_unlock( p_dest );
vlc_object_release( p_dest ); vlc_object_release( p_dest );
image_HandlerDelete( p_image ); image_HandlerDelete( p_image );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment