Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
7a5815af by Thomas Guillem at 2024-03-14T10:20:03+00:00
decoder: lock ModuleThread_PlaySpu()

ModuleThread_PlayAudio() and ModuleThread_PlayVideo() are called with
the lock held. There is no reason to not hold it for Spu. This avoid an
useless Lock() + Unlock().

vout_PutSubpicture() will now be called with the lock held.

- - - - -


1 changed file:

- src/input/decoder.c


Changes:

=====================================
src/input/decoder.c
=====================================
@@ -1569,9 +1569,7 @@ static void ModuleThread_PlaySpu( vlc_input_decoder_t 
*p_owner, subpicture_t *p_
     }
 
     /* */
-    vlc_fifo_Lock(p_owner->p_fifo);
     int ret = DecoderWaitUnblock(p_owner);
-    vlc_fifo_Unlock(p_owner->p_fifo);
 
     if (ret != VLC_SUCCESS || p_subpic->i_start == VLC_TICK_INVALID)
     {
@@ -1602,15 +1600,10 @@ static void ModuleThread_QueueSpu( decoder_t *p_dec, 
subpicture_t *p_spu )
     if( p_spu->i_start != VLC_TICK_INVALID &&
         p_spu->i_start < p_owner->i_preroll_end &&
         ( p_spu->i_stop == VLC_TICK_INVALID || p_spu->i_stop < 
p_owner->i_preroll_end ) )
-    {
-        vlc_fifo_Unlock(p_owner->p_fifo);
         subpicture_Delete( p_spu );
-    }
     else
-    {
-        vlc_fifo_Unlock(p_owner->p_fifo);
         ModuleThread_PlaySpu( p_owner, p_spu );
-    }
+    vlc_fifo_Unlock(p_owner->p_fifo);
 }
 
 static void DecoderThread_ProcessInput( vlc_input_decoder_t *p_owner, 
vlc_frame_t *frame );



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7a5815afc3158d85c25d47466a05b4dd2de2133e

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7a5815afc3158d85c25d47466a05b4dd2de2133e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to