[vlc-commits] demux: adaptive: missing lock
Francois Cartegnie
git at videolan.org
Mon Mar 30 16:15:30 CEST 2020
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 16 14:19:17 2019 +0200| [f3a82e7319efb86d40ca3cdfc3f7f303a087c627] | committer: Francois Cartegnie
demux: adaptive: missing lock
(cherry picked from commit ed3dea76c6be9a397df4d8b8546381b1cbe68648)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f3a82e7319efb86d40ca3cdfc3f7f303a087c627
---
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 9d34d1779f..a74eb765be 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -271,11 +271,25 @@ void FakeESOut::recycle( FakeESOutID *id )
recycle_candidates.push_back( id );
}
+void FakeESOut::checkTimestampsStart(mtime_t i_start)
+{
+ if( i_start == VLC_TS_INVALID )
+ return;
+
+ if( !timestamps_check_done )
+ {
+ if( i_start < CLOCK_FREQ ) /* 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 = (FakeESOut *) fakees->p_sys;
+ 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;
@@ -301,19 +315,6 @@ es_out_id_t * FakeESOut::esOutAdd_Callback(es_out_t *fakees, const es_format_t *
return NULL;
}
-void FakeESOut::checkTimestampsStart(mtime_t i_start)
-{
- if( i_start == VLC_TS_INVALID )
- return;
-
- if( !timestamps_check_done )
- {
- if( i_start < CLOCK_FREQ ) /* 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 = (FakeESOut *) fakees->p_sys;
More information about the vlc-commits
mailing list