]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7500: add force flag
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 3 Mar 2015 03:07:48 +0000 (21:07 -0600)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:07 +0000 (12:47 -0500)
src/include/switch_types.h
src/switch_core_media.c

index 7cda2838a15e87468985d9f6939a8f92e368d2d5..f54ec37661a9a14a39c234be2892e91152ee4115 100644 (file)
@@ -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;
 
index d87ed918ce52d24b90d36f3fb4431e91986ddeec..c1f8e7e9e076ec4e7724e2cf1bde823928d4f784 100644 (file)
@@ -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);