]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11425 fix token_parts should be 0 .. 3 based on number of cpu
authorSeven Du <seven@signalwire.com>
Fri, 1 Feb 2019 01:38:18 +0000 (09:38 +0800)
committerAndrey Volk <andywolk@gmail.com>
Tue, 16 Jul 2019 21:08:51 +0000 (01:08 +0400)
src/switch_vpx.c

index 20f0abc9908f39b5aaf12fe7a9c260846a55c9fc..be9266ae9ce1f89284169f7d6856f2da9e98cc51 100644 (file)
@@ -1573,6 +1573,8 @@ static my_vpx_cfg_t *find_cfg_profile(const char *name, switch_bool_t reconfig)
                                init_vp8(vpx_globals.profiles[i]);
                        }
 
+                       vpx_globals.profiles[i]->token_parts = switch_core_cpu_count() > 1 ? 3 : 0;
+
                        return vpx_globals.profiles[i];
                }
 
@@ -1782,7 +1784,7 @@ static void parse_profile(my_vpx_cfg_t *my_cfg, switch_xml_t profile, int codec_
                                _VPX_CHECK_MIN_MAX(my_cfg->cpuused, val, -8, 8);
                        }
                } else if (!strcmp(name, "token-parts")) {
-                       _VPX_CHECK_MIN_MAX(my_cfg->token_parts, val, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION);
+                       _VPX_CHECK_MIN_MAX(my_cfg->token_parts, switch_parse_cpu_string(value), VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION);
                } else if (!strcmp(name, "static-thresh")) {
                        _VPX_CHECK_MIN(my_cfg->static_thresh, val, 0);
                } else if (!strcmp(name, "noise-sensitivity")) {