]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7508: parse both bw vars the same
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 3 Feb 2015 17:52:42 +0000 (11:52 -0600)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:46:57 +0000 (12:46 -0500)
src/mod/codecs/mod_vpx/mod_vpx.c
src/switch_core_media.c

index 92cc84f458c268c8a081041a6eb8f32b4bd23a33..287f6653d29bf42b1d20a3d725b5a5ef6212b9d4 100644 (file)
@@ -100,7 +100,7 @@ static switch_status_t init_codec(switch_codec_t *codec)
        if (context->codec_settings.video.bandwidth) {
                context->bandwidth = context->codec_settings.video.bandwidth;
        } else {
-               context->bandwidth = context->codec_settings.video.width * context->codec_settings.video.height / 1024;
+               context->bandwidth = context->codec_settings.video.width * context->codec_settings.video.height / 512;
        }
 
        if (context->bandwidth > 5120) {
index c51021e2d26bce2d061e2f26cf60c529920276ee..7be5edcad43bea1e63605ad98d9b9d5b1298d500 100644 (file)
@@ -7295,6 +7295,15 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                                if (vbw) {
                                        int v = atoi(vbw);
                                        bw = v;
+
+                                       if (switch_stristr("KB", vbw)) {
+                                               bw *= 8;
+                                       } else if (switch_stristr("mb", vbw)) {
+                                               bw *= 1024;
+                                       } else if (switch_stristr("MB", vbw)) {
+                                               bw *= 8192;
+                                       }
+
                                }
                                
                                if (bw > 0) {