int sanity = 0;
while (context->thread_running) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for stream to terminate: %s\n", context->stream_url);
switch_yield(500000);
if (++sanity > 10) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Giving up waiting for stream to terminate: %s\n", context->stream_url);
break;
}
}
context->eof++;
} else if (decode_status == MPG123_ERR || decode_status > 0) {
if (++context->mp3err >= 5) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decoder Error!\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decoder Error! %s\n", context->stream_url);
context->eof++;
goto error;
}
switch_mutex_unlock(context->audio_mutex);
} while (!context->err && !context->eof && decode_status != MPG123_NEED_MORE);
+ if (context->err) {
+ goto error;
+ }
+
return realsize;
error: