mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-27 12:50:49 +03:00
fixed coexistence
This commit is contained in:
@@ -65,7 +65,7 @@ static void *decode_thread() {
|
|||||||
toend = (stream.state <= DISCONNECT);
|
toend = (stream.state <= DISCONNECT);
|
||||||
UNLOCK_S;
|
UNLOCK_S;
|
||||||
LOCK_O;
|
LOCK_O;
|
||||||
space = !output.external ? _buf_space(outputbuf) : 0;
|
space = _buf_space(outputbuf);
|
||||||
UNLOCK_O;
|
UNLOCK_O;
|
||||||
|
|
||||||
LOCK_D;
|
LOCK_D;
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, ...)
|
|||||||
output.state = OUTPUT_STOPPED;
|
output.state = OUTPUT_STOPPED;
|
||||||
output.frames_played = 0;
|
output.frames_played = 0;
|
||||||
_buf_flush(outputbuf);
|
_buf_flush(outputbuf);
|
||||||
|
if (decode.state != DECODE_STOPPED) decode.state = DECODE_ERROR;
|
||||||
bt_master(true);
|
bt_master(true);
|
||||||
LOG_INFO("BT sink started");
|
LOG_INFO("BT sink started");
|
||||||
break;
|
break;
|
||||||
@@ -239,6 +240,7 @@ static bool raop_sink_cmd_handler(raop_event_t event, void *param)
|
|||||||
output.frames_played = 0;
|
output.frames_played = 0;
|
||||||
output.external = DECODE_RAOP;
|
output.external = DECODE_RAOP;
|
||||||
output.state = OUTPUT_STOPPED;
|
output.state = OUTPUT_STOPPED;
|
||||||
|
if (decode.state != DECODE_STOPPED) decode.state = DECODE_ERROR;
|
||||||
raop_master(true);
|
raop_master(true);
|
||||||
LOG_INFO("resizing buffer %u", outputbuf->size);
|
LOG_INFO("resizing buffer %u", outputbuf->size);
|
||||||
break;
|
break;
|
||||||
@@ -333,5 +335,4 @@ void decode_resume(int external) {
|
|||||||
raop_state = RAOP_STOP;
|
raop_state = RAOP_STOP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_buf_resize(outputbuf, output.init_size);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ static void process_strm(u8_t *pkt, int len) {
|
|||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
decode_flush();
|
decode_flush();
|
||||||
output_flush();
|
if (!output.external) output_flush();
|
||||||
status.frames_played = 0;
|
status.frames_played = 0;
|
||||||
stream_disconnect();
|
stream_disconnect();
|
||||||
sendSTAT("STMf", 0);
|
sendSTAT("STMf", 0);
|
||||||
@@ -291,7 +291,7 @@ static void process_strm(u8_t *pkt, int len) {
|
|||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
decode_flush();
|
decode_flush();
|
||||||
output_flush();
|
if (!output.external) output_flush();
|
||||||
status.frames_played = 0;
|
status.frames_played = 0;
|
||||||
if (stream_disconnect()) {
|
if (stream_disconnect()) {
|
||||||
sendSTAT("STMf", 0);
|
sendSTAT("STMf", 0);
|
||||||
@@ -330,12 +330,6 @@ static void process_strm(u8_t *pkt, int len) {
|
|||||||
LOCK_O;
|
LOCK_O;
|
||||||
output.state = jiffies ? OUTPUT_START_AT : OUTPUT_RUNNING;
|
output.state = jiffies ? OUTPUT_START_AT : OUTPUT_RUNNING;
|
||||||
output.start_at = jiffies;
|
output.start_at = jiffies;
|
||||||
#if EMBEDDED
|
|
||||||
if (output.external) {
|
|
||||||
decode_resume(output.external);
|
|
||||||
output.external = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
UNLOCK_O;
|
UNLOCK_O;
|
||||||
|
|
||||||
LOG_DEBUG("unpause at: %u now: %u", jiffies, gettime_ms());
|
LOG_DEBUG("unpause at: %u now: %u", jiffies, gettime_ms());
|
||||||
@@ -382,6 +376,7 @@ static void process_strm(u8_t *pkt, int len) {
|
|||||||
#if EMBEDDED
|
#if EMBEDDED
|
||||||
if (output.external) decode_resume(output.external);
|
if (output.external) decode_resume(output.external);
|
||||||
output.external = 0;
|
output.external = 0;
|
||||||
|
_buf_resize(outputbuf, output.init_size);
|
||||||
#endif
|
#endif
|
||||||
output.threshold = strm->output_threshold;
|
output.threshold = strm->output_threshold;
|
||||||
output.next_replay_gain = unpackN(&strm->replay_gain);
|
output.next_replay_gain = unpackN(&strm->replay_gain);
|
||||||
|
|||||||
Reference in New Issue
Block a user