mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
add channels arg to codec
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@227 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -202,7 +202,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_se
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *codec_name, int rate, int ms, switch_codec_flag flags, const switch_codec_settings *codec_settings, switch_memory_pool *pool)
|
||||
SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *codec_name, int rate, int ms, int channels, switch_codec_flag flags, const switch_codec_settings *codec_settings, switch_memory_pool *pool)
|
||||
{
|
||||
const switch_codec_interface *codec_interface;
|
||||
const switch_codec_implementation *iptr, *implementation = NULL;
|
||||
@@ -218,7 +218,9 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
|
||||
}
|
||||
|
||||
for(iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
|
||||
if ((!rate || rate == iptr->samples_per_second) && (!ms || ms == (iptr->microseconds_per_frame / 1000))) {
|
||||
if ((!rate || rate == iptr->samples_per_second) &&
|
||||
(!ms || ms == (iptr->microseconds_per_frame / 1000)) &&
|
||||
(!channels || channels == iptr->number_of_channels)) {
|
||||
implementation = iptr;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user