From: Anthony Minessale Date: Tue, 3 Mar 2015 03:07:48 +0000 (-0600) Subject: FS-7500: add force flag X-Git-Tag: v1.6.2~614^2~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78d06832e7f87a276b185a77dead18fdca23d8b0;p=thirdparty%2Ffreeswitch.git FS-7500: add force flag --- diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 7cda2838a1..f54ec37661 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1769,7 +1769,8 @@ typedef uint32_t switch_file_flag_t; typedef enum { SWITCH_IO_FLAG_NONE = 0, SWITCH_IO_FLAG_NOBLOCK = (1 << 0), - SWITCH_IO_FLAG_SINGLE_READ = (1 << 1) + SWITCH_IO_FLAG_SINGLE_READ = (1 << 1), + SWITCH_IO_FLAG_FORCE = (1 << 2) } switch_io_flag_enum_t; typedef uint32_t switch_io_flag_t; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index d87ed918ce..c1f8e7e9e0 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -4763,7 +4763,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi switch_mutex_unlock(mh->file_mutex); } else if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) { fr.img = blank_img; - switch_core_session_write_video_frame(session, &fr, SWITCH_IO_FLAG_NONE, 0); + switch_core_session_write_video_frame(session, &fr, SWITCH_IO_FLAG_NONE, SWITCH_IO_FLAG_FORCE); } if (read_frame && (switch_channel_test_flag(channel, CF_VIDEO_ECHO))) { @@ -10037,6 +10037,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor return SWITCH_STATUS_SUCCESS; } + if (!(switch_channel_test_flag(session->channel, CF_VIDEO_READY) || (flags & SWITCH_IO_FLAG_FORCE))) { + return SWITCH_STATUS_SUCCESS; + } + if (!smh->video_init && smh->mparams->video_key_first && (now - smh->video_last_key_time) > smh->mparams->video_key_first) { switch_core_media_gen_key_frame(session);