[vlc-devel] commit: Improved vout picture locking scheme. (Laurent Aimar )

git version control git at videolan.org
Wed Oct 15 21:30:43 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Oct 14 22:46:21 2008 +0200| [acf420dbd2a8e2dbd82c39d580325708500099d7] | committer: Laurent Aimar 

Improved vout picture locking scheme.

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

 src/video_output/video_output.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d0a8dc9..ae354e7 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -931,10 +931,9 @@ static void* RunThread( vlc_object_t *p_this )
         picture_t *p_directbuffer;
         int i_index;
 
-        /*
-         * Find the picture to display (the one with the earliest date).
-         * This operation does not need lock, since only READY_PICTUREs
-         * are handled. */
+        /* Find the picture to display (the one with the earliest date). */
+        vlc_mutex_lock( &p_vout->picture_lock );
+
         for( i_index = 0; i_index < I_RENDERPICTURES; i_index++ )
         {
             picture_t *p_pic = PP_RENDERPICTURE[i_index];
@@ -1014,6 +1013,7 @@ static void* RunThread( vlc_object_t *p_this )
                 p_vout->p->i_picture_lost++;
                 msg_Warn( p_vout, "late picture skipped (%"PRId64")",
                                   current_date - display_date );
+                vlc_mutex_unlock( &p_vout->picture_lock );
                 continue;
             }
 
@@ -1043,6 +1043,7 @@ static void* RunThread( vlc_object_t *p_this )
                 }
             }
         }
+        vlc_mutex_unlock( &p_vout->picture_lock );
 
         if( p_picture == NULL )
             i_idle_loops++;




More information about the vlc-devel mailing list