From 5f84dc3cb08752b5f62499c94942df3c58cb02f2 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Tue, 4 Feb 2020 00:41:33 -0800 Subject: [PATCH] wait to switch external AMP GPIO even when stopping (pause = stop for stream) --- components/services/monitor.c | 2 +- components/squeezelite/slimproto.c | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/components/services/monitor.c b/components/services/monitor.c index e6c31536..09a4b008 100644 --- a/components/services/monitor.c +++ b/components/services/monitor.c @@ -89,7 +89,7 @@ bool spkfault_svc (void) { */ void set_jack_gpio(int gpio, char *value) { if (!strcasecmp(value, "jack")) { - ESP_LOGI(TAG,"Adding jack detection gpio %d", gpio); + ESP_LOGI(TAG,"Adding jack detection GPIO %d", gpio); gpio_pad_select_gpio(JACK_GPIO); gpio_set_direction(JACK_GPIO, GPIO_MODE_INPUT); diff --git a/components/squeezelite/slimproto.c b/components/squeezelite/slimproto.c index 34c8f193..73d59d66 100644 --- a/components/squeezelite/slimproto.c +++ b/components/squeezelite/slimproto.c @@ -284,22 +284,14 @@ static void process_strm(u8_t *pkt, int len) { case 't': sendSTAT("STMt", strm->replay_gain); // STMt replay_gain is no longer used to track latency, but support it break; + case 'f': case 'q': decode_flush(); if (!output.external) output_flush(); status.frames_played = 0; - stream_disconnect(); - sendSTAT("STMf", 0); - buf_flush(streambuf); - break; - case 'f': - decode_flush(); - if (!output.external) output_flush(); - status.frames_played = 0; - if (stream_disconnect()) { - sendSTAT("STMf", 0); - } + if (stream_disconnect() && strm->command == 'f') sendSTAT("STMf", 0); buf_flush(streambuf); + output.stop_time = gettime_ms(); break; case 'p': {