This commit is contained in:
philippe44
2019-08-18 00:02:00 -07:00
parent e9731ee232
commit 82bf8c507e
2 changed files with 7 additions and 5 deletions

View File

@@ -72,7 +72,7 @@ static log_level *loglevel = &raop_loglevel;
static log_level *loglevel = &raop_loglevel;
//#define __RTP_STORE
// default buffer size
#define BUFFER_FRAMES ( (120 * 44100) / (352 * 100) )
#define MAX_PACKET 1408
@@ -499,6 +499,7 @@ static void buffer_push_packet(rtp_t *ctx) {
/*
if (now > playtime + ctx->frame_duration) {
//LOG_INFO("[%p]: discarded frame (W:%hu R:%hu)", ctx, ctx->ab_write, ctx->ab_read);
} else if (curframe->ready) {
ctx->callback((const u8_t*) curframe->data, curframe->len);
curframe->ready = 0;
} else if (now >= playtime) {
@@ -508,6 +509,7 @@ static void buffer_push_packet(rtp_t *ctx) {
} else break;
*/
if (curframe->ready) {
ctx->callback((const u8_t*) curframe->data, curframe->len);
curframe->ready = 0;
} else if (now >= playtime) {

View File

@@ -118,8 +118,8 @@ static void bt_sink_cmd_handler(bt_sink_cmd_t cmd, ...)
LOG_INFO("BT sink stopped");
break;
case BT_SINK_RATE:
output.current_sample_rate = va_arg(args, u32_t);
LOG_INFO("Setting BT sample rate %u", output.current_sample_rate);
output.next_sample_rate = va_arg(args, u32_t);
LOG_INFO("Setting BT sample rate %u", output.next_sample_rate);
break;
case BT_SINK_VOLUME: {
u16_t volume = (u16_t) va_arg(args, u32_t);
@@ -157,9 +157,9 @@ void raop_sink_cmd_handler(raop_event_t event, void *param)
LOG_INFO("Stream", NULL);
raop_state = event;
output.external = true;
output.current_sample_rate = 44100;
output.next_sample_rate = 44100;
output.state = OUTPUT_BUFFER;
output.threshold = 5;
output.threshold = 10;
break;
case RAOP_STOP:
LOG_INFO("Stop", NULL);