Commit 350a4654 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Store audio route if set early and apply when audio stream starts

parent e5a58ca1
......@@ -397,6 +397,7 @@ struct _AudioStream
bool_t eq_active;
bool_t use_ng;/*noise gate*/
bool_t is_ec_delay_set;
MSAudioRoute audio_route;
};
/**
......
......@@ -934,7 +934,6 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
/* need to add resampler*/
if (stream->write_resampler == NULL) stream->write_resampler = ms_filter_new(MS_RESAMPLE_ID);
}
if (stream->ec){
if (!stream->is_ec_delay_set) {
......@@ -1139,6 +1138,12 @@ int audio_stream_start_from_io(AudioStream *stream, RtpProfile *profile, const c
stream->ms.is_beginning=TRUE;
stream->ms.state=MSStreamStarted;
if (stream->soundwrite) {
if (ms_filter_implements_interface(stream->soundwrite, MSFilterAudioPlaybackInterface)) {
ms_filter_call_method(stream->soundwrite, MS_AUDIO_PLAYBACK_SET_ROUTE, &stream->audio_route);
}
}
return 0;
}
......@@ -1713,6 +1718,7 @@ void audio_stream_unlink_video(AudioStream *stream, VideoStream *video){
}
void audio_stream_set_audio_route(AudioStream *stream, MSAudioRoute route) {
stream->audio_route = route;
if (stream->soundwrite) {
if (ms_filter_implements_interface(stream->soundwrite, MSFilterAudioPlaybackInterface)) {
ms_filter_call_method(stream->soundwrite, MS_AUDIO_PLAYBACK_SET_ROUTE, &route);
......
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