Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
liblinphone
Commits
a96f288f
Commit
a96f288f
authored
15 years ago
by
jehan
Browse files
Options
Download
Patches
Plain Diff
fix resampler configuration issue
parent
ea8fe673
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linphone/mediastreamer2/src/audiostream.c
+10
-5
linphone/mediastreamer2/src/audiostream.c
with
10 additions
and
5 deletions
linphone/mediastreamer2/src/audiostream.c
+
10
−
5
View file @
a96f288f
...
@@ -61,6 +61,8 @@ void audio_stream_free(AudioStream *stream)
...
@@ -61,6 +61,8 @@ void audio_stream_free(AudioStream *stream)
if
(
stream
->
volsend
!=
NULL
)
ms_filter_destroy
(
stream
->
volsend
);
if
(
stream
->
volsend
!=
NULL
)
ms_filter_destroy
(
stream
->
volsend
);
if
(
stream
->
equalizer
!=
NULL
)
ms_filter_destroy
(
stream
->
equalizer
);
if
(
stream
->
equalizer
!=
NULL
)
ms_filter_destroy
(
stream
->
equalizer
);
if
(
stream
->
ticker
!=
NULL
)
ms_ticker_destroy
(
stream
->
ticker
);
if
(
stream
->
ticker
!=
NULL
)
ms_ticker_destroy
(
stream
->
ticker
);
if
(
stream
->
read_resampler
!=
NULL
)
ms_filter_destroy
(
stream
->
read_resampler
);
if
(
stream
->
write_resampler
!=
NULL
)
ms_filter_destroy
(
stream
->
write_resampler
);
ms_free
(
stream
);
ms_free
(
stream
);
}
}
...
@@ -111,12 +113,13 @@ bool_t ms_is_ipv6(const char *remote){
...
@@ -111,12 +113,13 @@ bool_t ms_is_ipv6(const char *remote){
return
ret
;
return
ret
;
}
}
static
void
audio_stream_configure_resampler
(
AudioStream
*
st
,
MSFilter
*
from
,
MSFilter
*
to
)
{
static
void
audio_stream_configure_resampler
(
MSFilter
*
resampler
,
MSFilter
*
from
,
MSFilter
*
to
)
{
int
from_rate
=
0
,
to_rate
=
0
;
int
from_rate
=
0
,
to_rate
=
0
;
ms_filter_call_method
(
from
,
MS_FILTER_GET_SAMPLE_RATE
,
&
from_rate
);
ms_filter_call_method
(
from
,
MS_FILTER_GET_SAMPLE_RATE
,
&
from_rate
);
ms_filter_call_method
(
to
,
MS_FILTER_GET_SAMPLE_RATE
,
&
to_rate
);
ms_filter_call_method
(
to
,
MS_FILTER_GET_SAMPLE_RATE
,
&
to_rate
);
ms_filter_call_method
(
st
->
read_resampler
,
MS_FILTER_SET_SAMPLE_RATE
,
&
from_rate
);
ms_filter_call_method
(
resampler
,
MS_FILTER_SET_SAMPLE_RATE
,
&
from_rate
);
ms_filter_call_method
(
st
->
read_resampler
,
MS_FILTER_SET_OUTPUT_SAMPLE_RATE
,
&
to_rate
);
ms_filter_call_method
(
resampler
,
MS_FILTER_SET_OUTPUT_SAMPLE_RATE
,
&
to_rate
);
ms_debug
(
"configuring from rate[%i] to rate [%i]"
,
from_rate
,
to_rate
);
}
}
RtpSession
*
create_duplex_rtpsession
(
int
locport
,
bool_t
ipv6
){
RtpSession
*
create_duplex_rtpsession
(
int
locport
,
bool_t
ipv6
){
...
@@ -319,11 +322,11 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
...
@@ -319,11 +322,11 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_filter_call_method
(
stream
->
equalizer
,
MS_EQUALIZER_SET_ACTIVE
,
&
tmp
);
ms_filter_call_method
(
stream
->
equalizer
,
MS_EQUALIZER_SET_ACTIVE
,
&
tmp
);
/*configure resampler if needed*/
/*configure resampler if needed*/
if
(
stream
->
read_resampler
){
if
(
stream
->
read_resampler
){
audio_stream_configure_resampler
(
stream
,
stream
->
soundread
,
stream
->
rtpsend
);
audio_stream_configure_resampler
(
stream
->
read_resampler
,
stream
->
soundread
,
stream
->
rtpsend
);
}
}
if
(
stream
->
write_resampler
){
if
(
stream
->
write_resampler
){
audio_stream_configure_resampler
(
stream
,
stream
->
rtprecv
,
stream
->
soundwrite
);
audio_stream_configure_resampler
(
stream
->
write_resampler
,
stream
->
rtprecv
,
stream
->
soundwrite
);
}
}
/* and then connect all */
/* and then connect all */
/* tip: draw yourself the picture if you don't understand */
/* tip: draw yourself the picture if you don't understand */
...
@@ -538,6 +541,8 @@ void audio_stream_stop(AudioStream * stream)
...
@@ -538,6 +541,8 @@ void audio_stream_stop(AudioStream * stream)
ms_connection_helper_unlink
(
&
h
,
stream
->
volrecv
,
0
,
0
);
ms_connection_helper_unlink
(
&
h
,
stream
->
volrecv
,
0
,
0
);
if
(
stream
->
ec
!=
NULL
)
if
(
stream
->
ec
!=
NULL
)
ms_connection_helper_unlink
(
&
h
,
stream
->
ec
,
0
,
0
);
ms_connection_helper_unlink
(
&
h
,
stream
->
ec
,
0
,
0
);
if
(
stream
->
write_resampler
!=
NULL
)
ms_connection_helper_unlink
(
&
h
,
stream
->
write_resampler
,
0
,
0
);
ms_connection_helper_unlink
(
&
h
,
stream
->
soundwrite
,
0
,
-
1
);
ms_connection_helper_unlink
(
&
h
,
stream
->
soundwrite
,
0
,
-
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets