Commit 5e9a21c8 authored by Sandrine Avakian's avatar Sandrine Avakian

Merge branch 'master' of git.linphone.org:mediastreamer2 into dev_msfactory

# Conflicts:
#	src/voip/audiostream.c
parents 9cd60159 7053d54e
......@@ -198,10 +198,10 @@ LOCAL_CFLAGS += \
-DNDEBUG
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../../../externals/libmatroska \
$(LOCAL_PATH)/../../../externals/libmatroska/corec \
$(LOCAL_PATH)/../../../externals/libmatroska/libebml2 \
$(LOCAL_PATH)/../../../externals/libmatroska/libmatroska2
$(LOCAL_PATH)/../../../externals/libmatroska-c \
$(LOCAL_PATH)/../../../externals/libmatroska-c/corec \
$(LOCAL_PATH)/../../../externals/libmatroska-c/libebml2 \
$(LOCAL_PATH)/../../../externals/libmatroska-c/libmatroska2
LOCAL_SRC_FILES += \
utils/mkv_reader.c \
......
......@@ -719,14 +719,19 @@ static void setup_generic_confort_noise(AudioStream *stream){
PayloadType *pt=rtp_profile_get_payload(prof, rtp_session_get_send_payload_type(stream->ms.sessions.rtp_session));
PayloadType *cn=rtp_profile_find_payload(prof, "CN", 8000, 1);
if (cn && pt && pt->channels==1 && pt->clock_rate==8000){
/* RFC3389 CN can be used*/
stream->vaddtx=ms_factory_create_filter(stream->ms.factory, MS_VAD_DTX_ID);
if (stream->vaddtx) {
ms_filter_add_notify_callback(stream->vaddtx, on_silence_detected, stream, TRUE);
ms_filter_add_notify_callback(stream->ms.rtprecv, on_cn_received, stream, TRUE);
} else {
ms_warning("Cannot instantiate vaddtx filter!");
if (cn && pt && pt->channels==1){
int samplerate = pt->clock_rate;
ms_filter_call_method(stream->ms.decoder, MS_FILTER_GET_SAMPLE_RATE, &samplerate);
if (samplerate == 8000){
/* RFC3389 CN can be used only for 8khz codecs*/
stream->vaddtx=ms_factory_create_filter(stream->ms.factory, MS_VAD_DTX_ID);
if (stream->vaddtx) {
ms_filter_add_notify_callback(stream->vaddtx, on_silence_detected, stream, TRUE);
ms_filter_add_notify_callback(stream->ms.rtprecv, on_cn_received, stream, TRUE);
} else {
ms_warning("Cannot instantiate vaddtx filter!");
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment