summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tangara/audio/audio_fsm.cpp8
-rw-r--r--src/tangara/audio/playlist.cpp3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/tangara/audio/audio_fsm.cpp b/src/tangara/audio/audio_fsm.cpp
index 7c1b010d..a52d8427 100644
--- a/src/tangara/audio/audio_fsm.cpp
+++ b/src/tangara/audio/audio_fsm.cpp
@@ -287,9 +287,11 @@ void AudioState::react(const system_fsm::BluetoothEvent& ev) {
if (bt.connectionState() !=
drivers::Bluetooth::ConnectionState::kConnected) {
// If BT Disconnected, move to standby state
- events::Audio().Dispatch(audio::OutputModeChanged{
- .set_to = drivers::NvsStorage::Output::kHeadphones});
- transit<states::Standby>();
+ if (sOutput == sBtOutput) {
+ events::Audio().Dispatch(audio::OutputModeChanged{
+ .set_to = drivers::NvsStorage::Output::kHeadphones});
+ transit<states::Standby>();
+ }
return;
}
auto dev = sServices->bluetooth().pairedDevice();
diff --git a/src/tangara/audio/playlist.cpp b/src/tangara/audio/playlist.cpp
index f0876d4e..6ed5f162 100644
--- a/src/tangara/audio/playlist.cpp
+++ b/src/tangara/audio/playlist.cpp
@@ -305,6 +305,9 @@ auto Playlist::nextItem(std::span<TCHAR> buf)
if (line.ends_with('\n')) {
line = line.substr(0, line.size() - 1);
}
+ if (line.ends_with('\r')) {
+ line = line.substr(0, line.size() - 1);
+ }
return line;
}