mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
alignment to 4.0 + misc cspot fixes
This commit is contained in:
@@ -143,6 +143,7 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, va_list args)
|
||||
case BT_SINK_AUDIO_STOPPED:
|
||||
if (output.external == DECODE_BT) {
|
||||
if (output.state > OUTPUT_STOPPED) output.state = OUTPUT_STOPPED;
|
||||
output.external = 0;
|
||||
output.stop_time = gettime_ms();
|
||||
LOG_INFO("BT sink stopped");
|
||||
}
|
||||
@@ -287,6 +288,8 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args)
|
||||
output.next_sample_rate = output.current_sample_rate = RAOP_SAMPLE_RATE;
|
||||
break;
|
||||
case RAOP_STOP:
|
||||
output.external = 0;
|
||||
__attribute__ ((fallthrough));
|
||||
case RAOP_FLUSH:
|
||||
LOG_INFO("%s", event == RAOP_FLUSH ? "Flush" : "Stop");
|
||||
_buf_flush(outputbuf);
|
||||
@@ -355,6 +358,7 @@ static bool cspot_cmd_handler(cspot_event_t cmd, va_list args)
|
||||
case CSPOT_DISC:
|
||||
_buf_flush(outputbuf);
|
||||
abort_sink = true;
|
||||
output.external = 0;
|
||||
output.state = OUTPUT_STOPPED;
|
||||
output.stop_time = gettime_ms();
|
||||
LOG_INFO("CSpot disconnected");
|
||||
|
||||
@@ -361,7 +361,7 @@ bool sb_displayer_init(void) {
|
||||
|
||||
// create displayer management task
|
||||
displayer.mutex = xSemaphoreCreateMutex();
|
||||
displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "squeeze_displayer", SCROLL_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
|
||||
displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "sb_displayer", SCROLL_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
|
||||
|
||||
// chain handlers
|
||||
slimp_handler_chain = slimp_handler;
|
||||
@@ -1315,6 +1315,7 @@ static void displayer_task(void *args) {
|
||||
|
||||
// need to make sure we own display
|
||||
if (display && displayer.owned) GDS_Update(display);
|
||||
else if (!led_display) displayer.wake = LONG_WAKE;
|
||||
|
||||
// release semaphore and sleep what's needed
|
||||
xSemaphoreGive(displayer.mutex);
|
||||
|
||||
@@ -387,11 +387,14 @@ static void process_strm(u8_t *pkt, int len) {
|
||||
}
|
||||
sendSTAT("STMc", 0);
|
||||
sentSTMu = sentSTMo = sentSTMl = false;
|
||||
LOCK_O;
|
||||
#if EMBEDDED
|
||||
// not protected so that restore can call synchronously sink handlers
|
||||
if (output.external) decode_restore(output.external);
|
||||
LOCK_O;
|
||||
output.external = 0;
|
||||
_buf_limit(outputbuf, 0);
|
||||
#else
|
||||
LOCK_O;
|
||||
#endif
|
||||
output.threshold = strm->output_threshold;
|
||||
output.next_replay_gain = unpackN(&strm->replay_gain);
|
||||
|
||||
Reference in New Issue
Block a user