[vlc-devel] [PATCH 11/14] vout: lock picture pool when restarting vout thread
Felix Abecassis
felix.abecassis at gmail.com
Tue Sep 9 19:08:30 CEST 2014
The vout can now be restarted while the decoder is still running.
---
src/video_output/video_output.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 3f094d4..ec57207 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1422,17 +1422,25 @@ static void ThreadClean(vout_thread_t *vout)
static int ThreadReinit(vout_thread_t *vout,
const vout_configuration_t *cfg)
{
+ vout_thread_sys_t *sys = vout->p;
+ vlc_mutex_lock(&sys->picture_lock);
+
video_format_t original;
if (VoutValidateFormat(&original, cfg->fmt)) {
ThreadStop(vout, NULL);
ThreadClean(vout);
+ vlc_mutex_unlock(&sys->picture_lock);
return VLC_EGENERIC;
}
+
/* We ignore crop/ar changes at this point, they are dynamically supported */
VideoFormatCopyCropAr(&vout->p->original, &original);
if (video_format_IsSimilar(&original, &vout->p->original)) {
if (cfg->dpb_size <= vout->p->dpb_size)
+ {
+ vlc_mutex_unlock(&sys->picture_lock);
return VLC_SUCCESS;
+ }
msg_Warn(vout, "DPB need to be increased");
}
@@ -1454,8 +1462,11 @@ static int ThreadReinit(vout_thread_t *vout,
vout->p->dpb_size = cfg->dpb_size;
if (ThreadStart(vout, &state)) {
ThreadClean(vout);
+ vlc_mutex_unlock(&sys->picture_lock);
return VLC_EGENERIC;
}
+
+ vlc_mutex_unlock(&sys->picture_lock);
return VLC_SUCCESS;
}
--
1.9.1
More information about the vlc-devel
mailing list