From ca49966f76f462690bbdcb5cdf4a249fbe0c23c9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 28 Oct 2015 16:35:06 -0500 Subject: [PATCH] update --- src/mod/applications/mod_conference/conference_video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index e3e952f84b..166b07b9b1 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1515,15 +1515,19 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_ if (member->video_layer_id > -1 && member->canvas_id > -1) { canvas = member->conference->canvases[member->canvas_id]; layer = &canvas->layers[member->video_layer_id]; + + if (!layer->need_patch || switch_thread_rwlock_tryrdlock(canvas->video_rwlock) != SWITCH_STATUS_SUCCESS) { + canvas = NULL; + layer = NULL; + } } + switch_mutex_unlock(member->conference->canvas_mutex); if (canvas && layer && layer->need_patch) { - switch_thread_rwlock_rdlock(canvas->video_rwlock); conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); layer->need_patch = 0; switch_thread_rwlock_unlock(canvas->video_rwlock); } - switch_mutex_unlock(member->conference->canvas_mutex); } }