提交 c71f89a3 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-6627

上级 1a58f058
......@@ -670,6 +670,7 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char
context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path);
context->prebuf = handle->prebuf;
launch_read_stream_thread(context);
switch_cond_next();
} else {
handle->seekable = 1;
......@@ -681,8 +682,26 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char
}
if (handle->handler) {
int sanity = 1000;
while(--sanity > 0 && !switch_buffer_inuse(context->audio_buffer)) {
switch_yield(20000);
}
if (!sanity) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s (data stream timeout)\n", path);
goto error;
}
}
mpg123_getformat(context->mh, &rate, &channels, &encoding);
if (!channels || !rate) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s (invalid rate or channel count)\n", path);
goto error;
}
handle->channels = channels;
handle->samplerate = rate;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论