[vlc-commits] demux: adaptive: missing lock

Francois Cartegnie git at videolan.org
Thu May 16 17:12:35 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 16 14:19:17 2019 +0200| [ed3dea76c6be9a397df4d8b8546381b1cbe68648] | committer: Francois Cartegnie

demux: adaptive: missing lock

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

 modules/demux/adaptive/plumbing/FakeESOut.cpp | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index 8c922c8461..4b2409cabf 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -292,11 +292,25 @@ void FakeESOut::recycle( FakeESOutID *id )
     recycle_candidates.push_back( id );
 }
 
+void FakeESOut::checkTimestampsStart(vlc_tick_t i_start)
+{
+    if( i_start == VLC_TICK_INVALID )
+        return;
+
+    if( !timestamps_check_done )
+    {
+        if( i_start < VLC_TICK_FROM_SEC(1) ) /* Starts 0 */
+            timestamps_offset = timestamps_expected;
+        timestamps_check_done = true;
+    }
+}
+
 /* Static callbacks */
 /* Always pass Fake ES ID to slave demuxes, it is just an opaque struct to them */
 es_out_id_t * FakeESOut::esOutAdd_Callback(es_out_t *fakees, const es_format_t *p_fmt)
 {
     FakeESOut *me = container_of(fakees, es_out_fake, es_out)->fake;
+    vlc_mutex_locker locker(&me->lock);
 
     if( p_fmt->i_cat != VIDEO_ES && p_fmt->i_cat != AUDIO_ES && p_fmt->i_cat != SPU_ES )
         return NULL;
@@ -321,19 +335,6 @@ es_out_id_t * FakeESOut::esOutAdd_Callback(es_out_t *fakees, const es_format_t *
     return NULL;
 }
 
-void FakeESOut::checkTimestampsStart(vlc_tick_t i_start)
-{
-    if( i_start == VLC_TICK_INVALID )
-        return;
-
-    if( !timestamps_check_done )
-    {
-        if( i_start < VLC_TICK_FROM_SEC(1) ) /* Starts 0 */
-            timestamps_offset = timestamps_expected;
-        timestamps_check_done = true;
-    }
-}
-
 int FakeESOut::esOutSend_Callback(es_out_t *fakees, es_out_id_t *p_es, block_t *p_block)
 {
     FakeESOut *me = container_of(fakees, es_out_fake, es_out)->fake;



More information about the vlc-commits mailing list