[vlc-commits] [Git][videolan/vlc][master] 8 commits: addons: signal while locked
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Feb 8 10:51:30 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
dba9e39f by Thomas Guillem at 2024-02-08T10:26:57+00:00
addons: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
cc88610f by Thomas Guillem at 2024-02-08T10:26:57+00:00
test: executor: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
bfa78725 by Thomas Guillem at 2024-02-08T10:26:57+00:00
VCLOpenGLES2VideoView: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
51f6f059 by Thomas Guillem at 2024-02-08T10:26:57+00:00
chromecast: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
99dec22f by Thomas Guillem at 2024-02-08T10:26:57+00:00
adaptive: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
d6d68042 by Thomas Guillem at 2024-02-08T10:26:57+00:00
mmal: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
67680886 by Thomas Guillem at 2024-02-08T10:26:57+00:00
medialibrary: signal while locked
It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.
- - - - -
bd568db5 by Thomas Guillem at 2024-02-08T10:26:57+00:00
hds: attempt to fix locking
This module was not thread-safe, and is still likely not thread-safe.
- - - - -
8 changed files:
- modules/demux/adaptive/http/Chunk.cpp
- modules/hw/mmal/mmal_cma.c
- modules/misc/medialibrary/Thumbnailer.cpp
- modules/stream_filter/hds/hds.c
- modules/stream_out/chromecast/chromecast_ctrl.cpp
- modules/video_output/apple/VLCOpenGLES2VideoView.m
- src/misc/addons.c
- src/test/executor.c
Changes:
=====================================
modules/demux/adaptive/http/Chunk.cpp
=====================================
@@ -428,6 +428,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
rate.size = buffered;
rate.time = downloadEndTime - requestStartTime;
rate.latency = responseTime - requestStartTime;
+ avail.signal();
}
else
{
@@ -448,6 +449,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
rate.time = downloadEndTime - requestStartTime;
rate.latency = responseTime - requestStartTime;
}
+ avail.signal();
}
if(rate.size && rate.time && type == ChunkType::Segment)
@@ -455,8 +457,6 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
connManager->updateDownloadRate(sourceid, rate.size,
rate.time, rate.latency);
}
-
- avail.signal();
}
bool HTTPChunkBufferedSource::hasMoreData() const
=====================================
modules/hw/mmal/mmal_cma.c
=====================================
@@ -209,9 +209,8 @@ static void cma_pool_fixed_put(cma_pool_fixed_t * const p, cma_buf_t * v, const
if (was_in_flight)
--p->in_flight;
- vlc_mutex_unlock(&p->lock);
-
vlc_cond_signal(&p->flight_cond);
+ vlc_mutex_unlock(&p->lock);
if (v != NULL)
cma_pool_delete(v);
=====================================
modules/misc/medialibrary/Thumbnailer.cpp
=====================================
@@ -46,13 +46,11 @@ void Thumbnailer::onThumbnailComplete( void* data, picture_t* thumbnail )
{
ThumbnailerCtx* ctx = static_cast<ThumbnailerCtx*>( data );
- {
- vlc::threads::mutex_locker lock( ctx->thumbnailer->m_mutex );
- ctx->done = true;
- if (thumbnail != nullptr)
- ctx->thumbnail = picture_Hold(thumbnail);
- ctx->thumbnailer->m_currentContext = nullptr;
- }
+ vlc::threads::mutex_locker lock( ctx->thumbnailer->m_mutex );
+ ctx->done = true;
+ if (thumbnail != nullptr)
+ ctx->thumbnail = picture_Hold(thumbnail);
+ ctx->thumbnailer->m_currentContext = nullptr;
ctx->thumbnailer->m_cond.signal();
}
=====================================
modules/stream_filter/hds/hds.c
=====================================
@@ -1051,6 +1051,7 @@ static void maintain_live_chunks(
hds_stream_t* hds_stream
)
{
+ vlc_mutex_lock( &hds_stream->dl_lock );
if( ! hds_stream->chunks_head )
{
/* just start with the earliest in the abst
@@ -1095,6 +1096,7 @@ static void maintain_live_chunks(
hds_stream->chunks_livereadpos = hds_stream->chunks_head;
hds_stream->chunks_head = chunk;
+ vlc_mutex_unlock( &hds_stream->dl_lock );
}
@@ -1718,9 +1720,11 @@ static void Close( vlc_object_t *p_this )
hds_stream_t *stream = vlc_array_count(&p_sys->hds_streams) ?
p_sys->hds_streams.pp_elems[0] : NULL;
+ vlc_mutex_lock( &stream->dl_lock );
p_sys->closed = true;
if (stream)
vlc_cond_signal( & stream->dl_cond );
+ vlc_mutex_unlock( &stream->dl_lock );
vlc_join( p_sys->dl_thread, NULL );
@@ -1817,6 +1821,7 @@ static unsigned read_chunk_data(
/* new chunk generation is handled by a different thread in live case */
if( ! sys->live )
{
+ vlc_mutex_lock( &stream->dl_lock );
chunk = stream->chunks_head;
if( chunk )
{
@@ -1842,6 +1847,7 @@ static unsigned read_chunk_data(
if( dl )
vlc_cond_signal( & stream->dl_cond );
+ vlc_mutex_unlock( &stream->dl_lock );
}
return ( ((uint8_t*)buffer) - ((uint8_t*)buffer_start));
=====================================
modules/stream_out/chromecast/chromecast_ctrl.cpp
=====================================
@@ -451,12 +451,10 @@ bool intf_sys_t::isStateReady() const
void intf_sys_t::setPacing(bool do_pace)
{
- {
- vlc::threads::mutex_locker locker( m_lock );
- if( m_pace == do_pace )
- return;
- m_pace = do_pace;
- }
+ vlc::threads::mutex_locker locker( m_lock );
+ if( m_pace == do_pace )
+ return;
+ m_pace = do_pace;
m_pace_cond.signal();
}
=====================================
modules/video_output/apple/VLCOpenGLES2VideoView.m
=====================================
@@ -408,8 +408,8 @@ static void Close(vlc_gl_t *gl)
_gl_attached = NO;
[EAGLContext setCurrentContext:_previousEaglContext];
_previousEaglContext = nil;
- vlc_mutex_unlock(&_mutex);
vlc_cond_signal(&_gl_attached_wait);
+ vlc_mutex_unlock(&_mutex);
}
- (void)presentRenderbuffer
=====================================
src/misc/addons.c
=====================================
@@ -235,8 +235,8 @@ void addons_manager_Gather( addons_manager_t *p_manager, const char *psz_uri )
p_manager->p_priv->finder.b_live = true;
}
- vlc_mutex_unlock( &p_manager->p_priv->finder.lock );
vlc_cond_signal( &p_manager->p_priv->finder.waitcond );
+ vlc_mutex_unlock( &p_manager->p_priv->finder.lock );
}
/*****************************************************************************
@@ -553,8 +553,8 @@ static int InstallEntry( addons_manager_t *p_manager, addon_entry_t *p_entry )
else
p_manager->p_priv->installer.b_live = true;
}
- vlc_mutex_unlock( &p_manager->p_priv->installer.lock );
vlc_cond_signal( &p_manager->p_priv->installer.waitcond );
+ vlc_mutex_unlock( &p_manager->p_priv->installer.lock );
return VLC_SUCCESS;
}
=====================================
src/test/executor.c
=====================================
@@ -62,9 +62,8 @@ static void RunIncrement(void *userdata)
vlc_mutex_lock(&data->lock);
++data->ended;
- vlc_mutex_unlock(&data->lock);
-
vlc_cond_signal(&data->cond);
+ vlc_mutex_unlock(&data->lock);
}
static void test_single_runnable(void)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f1838135b70b18e2e6fde6cb9499da6c32459403...bd568db559159744778ec26489d7ca44bf11b9c2
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f1838135b70b18e2e6fde6cb9499da6c32459403...bd568db559159744778ec26489d7ca44bf11b9c2
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list