]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add new flag to frames to denote pass thru frames that are not audio
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 9 Sep 2011 18:56:04 +0000 (13:56 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 9 Sep 2011 18:56:04 +0000 (13:56 -0500)
src/include/switch_types.h
src/switch_core_io.c
src/switch_rtp.c

index 5a8d49ab4129e0086b1575cbbabc9d98493a437a..51ed3587e5adb4f0f53a384c60a920f8e09acbc9 100644 (file)
@@ -1203,7 +1203,8 @@ typedef enum {
        SFF_PROXY_PACKET = (1 << 5),
        SFF_DYNAMIC = (1 << 6),
        SFF_ZRTP = (1 << 7),
-       SFF_UDPTL_PACKET = (1 << 8)
+       SFF_UDPTL_PACKET = (1 << 8),
+       SFF_NOT_AUDIO = (1 << 9)
 } switch_frame_flag_enum_t;
 typedef uint32_t switch_frame_flag_t;
 
index c2b8c4608f3512af5da4527258be5588811b6322..587218339ae245f1e51f1448efe8cf80fad68a37 100644 (file)
@@ -265,6 +265,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                do_bugs = 1;
                need_codec = 1;
        }
+       
+       if (((*frame)->flags & SFF_NOT_AUDIO)) {
+               do_resample = 0;
+               do_bugs = 0;
+               need_codec = 0;
+       }
+
 
        if (switch_test_flag(session, SSF_READ_TRANSCODE) && !need_codec && switch_core_codec_ready(session->read_codec)) {
                switch_core_session_t *other_session;
@@ -792,6 +799,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                do_resample = TRUE;
        }
 
+
+       if ((frame->flags & SFF_NOT_AUDIO)) {
+               do_resample = 0;
+               do_bugs = 0;
+               need_codec = 0;
+       }
+
        if (switch_test_flag(session, SSF_WRITE_TRANSCODE) && !need_codec && switch_core_codec_ready(session->write_codec)) {
                switch_core_session_t *other_session;
                const char *uuid = switch_channel_get_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE);
index 1fbe5aeebefb88d09531d495a3d539d6dc822cd0..6d6c59b84bb0d2bc87ca3eb81c1d23bd2b9a265b 100644 (file)
@@ -3131,6 +3131,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        }
                }
 
+               if (((rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) || rtp_session->recv_msg.header.pt == 13)) {
+                       *flags |= SFF_NOT_AUDIO;
+               }
+
+
                /* ignore packets not meant for us unless the auto-adjust window is open */
                if (bytes) {
                        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ)) {