提交 a417c7ed authored 作者: Moises Silva's avatar Moises Silva

return silence frame in dahdi codec when there is no output from the decoder

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13265 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 9045735e
...@@ -383,8 +383,11 @@ static switch_status_t switch_dahdi_decode(switch_codec_t *codec, ...@@ -383,8 +383,11 @@ static switch_status_t switch_dahdi_decode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (0 == res) { if (0 == res) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device.\n", transcoder_name); memset(dbuf_linear, 0, codec->implementation->decoded_bytes_per_packet);
*decoded_data_len = 0; *decoded_data_len = codec->implementation->decoded_bytes_per_packet;
#ifdef DEBUG_DAHDI_CODEC
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device, returning silence frame of %d bytes.\n", transcoder_name, *decoded_data_len);
#endif
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
res = read(context->decoding_fd, dbuf_ulaw, sizeof(dbuf_ulaw)); res = read(context->decoding_fd, dbuf_ulaw, sizeof(dbuf_ulaw));
...@@ -508,7 +511,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load) ...@@ -508,7 +511,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load)
int spf = 160; int spf = 160;
int bpfd = 320; int bpfd = 320;
int bpfc = 20; int bpfc = 20;
int fpnp = 10; int fpnp = 20;
switch_core_codec_add_implementation(pool, switch_core_codec_add_implementation(pool,
codec_interface, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
...@@ -518,7 +521,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load) ...@@ -518,7 +521,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load)
8000, /* samples transferred per second */ 8000, /* samples transferred per second */
8000, /* actual samples transferred per second */ 8000, /* actual samples transferred per second */
8000, /* bits transferred per second */ 8000, /* bits transferred per second */
mpf, /* number of microseconds per frame (10ms frames) */ mpf, /* number of microseconds per frame */
spf, /* number of samples per frame */ spf, /* number of samples per frame */
bpfd, /* number of bytes per frame decompressed */ bpfd, /* number of bytes per frame decompressed */
bpfc, /* number of bytes per frame compressed */ bpfc, /* number of bytes per frame compressed */
...@@ -544,7 +547,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load) ...@@ -544,7 +547,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dahdi_codec_load)
8000, /* samples transferred per second */ 8000, /* samples transferred per second */
8000, /* actual samples transferred per second */ 8000, /* actual samples transferred per second */
8000, /* bits transferred per second */ 8000, /* bits transferred per second */
mpf, /* number of microseconds per frame (10ms frames) */ mpf, /* number of microseconds per frame */
spf, /* number of samples per frame */ spf, /* number of samples per frame */
bpfd, /* number of bytes per frame decompressed */ bpfd, /* number of bytes per frame decompressed */
bpfc, /* number of bytes per frame compressed */ bpfc, /* number of bytes per frame compressed */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论