From cc83b7ecd2225a62c6738884458f2b1e31b06049 Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Thu, 10 Nov 2016 01:58:56 -0500 Subject: [PATCH] FS-9725: Disable blank img with core_video_blank_image=false. --- src/switch_core_media.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 703fdb5c1a..8258c136bc 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5606,6 +5606,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi switch_rtp_engine_t *v_engine = NULL; const char *var; int buflen = SWITCH_RTP_MAX_BUF_LEN; + int blank_enabled = 1; if (!(smh = session->media_handle)) { return NULL; @@ -5614,7 +5615,11 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi switch_core_autobind_cpu(); if ((var = switch_channel_get_variable(session->channel, "core_video_blank_image"))) { - blank_img = switch_img_read_png(var, SWITCH_IMG_FMT_I420); + if (switch_false(var)) { + blank_enabled = 0; + } else { + blank_img = switch_img_read_png(var, SWITCH_IMG_FMT_I420); + } } if (!blank_img) { @@ -5709,7 +5714,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi vloops++; - send_blank = 1; + send_blank = blank_enabled; if (switch_channel_test_flag(channel, CF_VIDEO_READY) && !switch_test_flag(read_frame, SFF_CNG)) { switch_mutex_lock(mh->file_read_mutex);