tweak BT + start to add AirPlay

This commit is contained in:
philippe44
2019-08-16 23:22:46 -07:00
parent c3543bcf25
commit 2a770483a1
12 changed files with 155 additions and 15 deletions

View File

@@ -371,6 +371,7 @@ static void process_strm(u8_t *pkt, int len) {
sendSTAT("STMc", 0);
sentSTMu = sentSTMo = sentSTMl = false;
LOCK_O;
output.external = false;
output.threshold = strm->output_threshold;
output.next_replay_gain = unpackN(&strm->replay_gain);
output.fade_mode = strm->transition_type - '0';
@@ -688,7 +689,7 @@ static void slimproto_run() {
status.current_sample_rate = output.current_sample_rate;
status.updated = output.updated;
status.device_frames = output.device_frames;
if (output.track_started) {
_sendSTMs = true;
output.track_started = false;
@@ -703,7 +704,7 @@ static void slimproto_run() {
if (_start_output && (output.state == OUTPUT_STOPPED || output.state == OUTPUT_OFF)) {
output.state = OUTPUT_BUFFER;
}
if (output.state == OUTPUT_RUNNING && !sentSTMu && status.output_full == 0 && status.stream_state <= DISCONNECT &&
if (!output.external && output.state == OUTPUT_RUNNING && !sentSTMu && status.output_full == 0 && status.stream_state <= DISCONNECT &&
_decode_state == DECODE_STOPPED) {
_sendSTMu = true;
@@ -721,7 +722,7 @@ static void slimproto_run() {
output.state = OUTPUT_OFF;
LOG_DEBUG("output timeout");
}
if (output.state == OUTPUT_RUNNING && now - status.last > 1000) {
if (!output.external && output.state == OUTPUT_RUNNING && now - status.last > 1000) {
_sendSTMt = true;
status.last = now;
}