]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8876 make function public and use it in conference also
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 29 Feb 2016 22:22:13 +0000 (16:22 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 29 Feb 2016 22:22:13 +0000 (16:22 -0600)
src/include/switch_core.h
src/mod/applications/mod_conference/conference_video.c
src/switch_core_media.c

index e9e50824361a06b48762373b41f93fdf5dda750e..8014e95eae4e632d6c945905447863ba45be34c4 100644 (file)
@@ -2735,6 +2735,8 @@ SWITCH_DECLARE(const char *)switch_version_revision_human(void);
 SWITCH_DECLARE(const char *)switch_version_full(void);
 SWITCH_DECLARE(const char *)switch_version_full_human(void);
 
+SWITCH_DECLARE(void) switch_core_autobind_cpu(void);
+
 SWITCH_END_EXTERN_C
 #endif
 /* For Emacs:
index 758e8099695c1093bff370ea5e72f987e7252231..3c9981d306fdc466dfdb93949ed016ff14a04a33 100644 (file)
@@ -1486,6 +1486,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
                return NULL;
        }
 
+       switch_core_autobind_cpu();
+
        while(conference_utils_member_test_flag(member, MFLAG_RUNNING)) {
                if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) {
                        mcu_layer_t *layer = NULL;
index 14ad59a73ea95c1259508828b12bd85a40f73b41..9a61980f44be1d927e3761ca3e63169e29e46b74 100644 (file)
@@ -5147,9 +5147,11 @@ int next_cpu(void)
        return x;
 }
 
-static void bind_cpu(void)
+SWITCH_DECLARE(void) switch_core_autobind_cpu(void)
 {
-       switch_core_thread_set_cpu_affinity(next_cpu());
+       if (video_globals.cpu_count > 1) {
+               switch_core_thread_set_cpu_affinity(next_cpu());
+       }
 }
 
 
@@ -5174,7 +5176,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
                return NULL;
        }
 
-       bind_cpu();
+       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);