[vlc-devel] commit: embedded snapshot: properly lock/unlock the cache object ( Olivier Aubert )

git version control git at videolan.org
Thu Oct 23 16:36:48 CEST 2008


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Thu Oct 23 16:36:19 2008 +0200| [7b721c866d73ca48742c78239d348e05bdfaaefb] | committer: Olivier Aubert 

embedded snapshot: properly lock/unlock the cache object

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b721c866d73ca48742c78239d348e05bdfaaefb
---

 src/control/mediacontrol_audio_video.c |    1 -
 src/video_output/vout_intf.c           |    7 +++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/control/mediacontrol_audio_video.c b/src/control/mediacontrol_audio_video.c
index cf6f026..595532e 100644
--- a/src/control/mediacontrol_audio_video.c
+++ b/src/control/mediacontrol_audio_video.c
@@ -94,7 +94,6 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
     vlc_object_release( p_vout );
 
     p_snapshot = ( snapshot_t* ) p_cache->p_private;
-    vlc_object_unlock( p_cache );
     vlc_object_release( p_cache );
     vlc_object_release( p_input );
 
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index f12b24b..5bc5316 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -639,8 +639,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
         snapshot_t *p_snapshot;
         size_t i_size;
 
-        /* Object must be locked. We will unlock it once we get the
-           snapshot and written it to p_private */
+	vlc_object_lock( p_dest );
         p_dest->p_private = NULL;
 
         /* Save the snapshot to a memory zone */
@@ -650,6 +649,7 @@ 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_object_signal_unlocked( p_dest );
+	    vlc_object_unlock( p_dest );
             vlc_object_release( p_dest );
             return VLC_EGENERIC;
         }
@@ -662,6 +662,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             block_Release( p_block );
             image_HandlerDelete( p_image );
             vlc_object_signal_unlocked( p_dest );
+	    vlc_object_unlock( p_dest );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -679,6 +680,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
             free( p_snapshot );
             image_HandlerDelete( p_image );
             vlc_object_signal_unlocked( p_dest );
+	    vlc_object_unlock( p_dest );
             vlc_object_release( p_dest );
             return VLC_ENOMEM;
         }
@@ -690,6 +692,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
 
         /* Unlock the object */
         vlc_object_signal_unlocked( p_dest );
+	vlc_object_unlock( p_dest );
         vlc_object_release( p_dest );
 
         image_HandlerDelete( p_image );




More information about the vlc-devel mailing list