OPENZAP-24 audio problem on alaw wanpipe

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@581 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2008-10-03 22:19:40 +00:00
parent 5b2982a442
commit cd8e473df1

View File

@ -524,19 +524,10 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
if (zchan->type == ZAP_CHAN_TYPE_DQ921 || zchan->type == ZAP_CHAN_TYPE_DQ931) {
zchan->native_codec = zchan->effective_codec = ZAP_CODEC_NONE;
} else {
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_SET_CODEC;
if (zchan->native_codec == ZAP_CODEC_ULAW) {
tdm_api.wp_tdm_cmd.tdm_codec = 0;
} else if (zchan->native_codec == ZAP_CODEC_ALAW) {
tdm_api.wp_tdm_cmd.tdm_codec = 1;
} else {
tdm_api.wp_tdm_cmd.tdm_codec = 2;
}
zchan->effective_codec = zchan->native_codec;
wp_tdm_cmd_exec(zchan, &tdm_api);
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_SET_CODEC;
tdm_api.wp_tdm_cmd.tdm_codec = 0;
wp_tdm_cmd_exec(zchan, &tdm_api);
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_SET_USR_PERIOD;
tdm_api.wp_tdm_cmd.usr_period = wp_globals.codec_ms;
wp_tdm_cmd_exec(zchan, &tdm_api);