]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8382 #resolve [Segfault with inbound-proxy-media enabled]
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 22 Oct 2015 20:02:38 +0000 (15:02 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 22 Oct 2015 20:02:38 +0000 (15:02 -0500)
src/switch_core_media.c
src/switch_ivr_bridge.c

index 09266438f170033a3eda38eeaf010dd99141683b..06dc92ebaf3c283369559424ce7535a873332eda 100644 (file)
@@ -8662,7 +8662,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_VIDEO, 1);
                                clear_pmaps(v_engine);
                                pmap = switch_core_media_add_payload_map(session,
-                                                                                                                SWITCH_MEDIA_TYPE_AUDIO,
+                                                                                                                SWITCH_MEDIA_TYPE_VIDEO,
                                                                                                                 "PROXY-VID",
                                                                                                                 NULL,
                                                                                                                 NULL,
@@ -8675,11 +8675,15 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                v_engine->cur_payload_map = pmap;
 
                                switch_snprintf(vport_buf, sizeof(vport_buf), "%u", v_engine->adv_sdp_port);
+                               
                                if (switch_channel_media_ready(session->channel) && !switch_rtp_ready(v_engine->rtp_session)) {
                                        switch_channel_set_flag(session->channel, CF_VIDEO_POSSIBLE);
                                        switch_channel_set_flag(session->channel, CF_REINVITE);
                                        switch_core_media_activate_rtp(session);
                                }
+
+                               v_engine->codec_negotiated = 1;
+                               switch_core_media_set_video_codec(session, SWITCH_FALSE);
                        }
 
                        strncpy(q, p, 8);
index e25fff1bf55729dfc3ff0b4fdb2e03d99f807678..d17d3fa77c3412d68be94b175b5747f1d4421378 100644 (file)
@@ -77,28 +77,30 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
                        switch_codec_t *b_codec = switch_core_session_get_video_write_codec(vh->session_b);
                        switch_file_handle_t *fh;
 
-                       switch_assert(a_codec);
-                       switch_assert(b_codec);
-
                        if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
                                refresh_timer = refresh_cnt;
                        }
 
-                       if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) {
-                               if (a_codec->implementation->impl_id == b_codec->implementation->impl_id && !switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
-                                       if (set_decoded_read) {
-                                               switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
-                                               set_decoded_read = 0;
+                       if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                               switch_assert(a_codec);
+                               switch_assert(b_codec);
+
+                               if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) {
+                                       if (a_codec->implementation->impl_id == b_codec->implementation->impl_id && !switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
+                                               if (set_decoded_read) {
+                                                       switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
+                                                       set_decoded_read = 0;
+                                                       refresh_timer = refresh_cnt;
+                                               }
+                                       }
+                               } else {
+                                       if (a_codec->implementation->impl_id != b_codec->implementation->impl_id || 
+                                               switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
+                                               switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
+                                               set_decoded_read = 1;
                                                refresh_timer = refresh_cnt;
                                        }
                                }
-                       } else {
-                               if (a_codec->implementation->impl_id != b_codec->implementation->impl_id || 
-                                       switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
-                                       switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
-                                       set_decoded_read = 1;
-                                       refresh_timer = refresh_cnt;
-                               }
                        }
 
                        if (refresh_timer) {