fix: MPRIS loop tokio::select!() panic on exit

This fixes a bug that would cause a panic when quiting the process
normally. `tokio::select!()` was used to await a single branch, which is
useless as it can be replaced by a normal await.
This commit is contained in:
Thomas Frans
2023-10-04 11:51:52 +02:00
committed by Henrik Friedrichsen
parent 51d1b34ccc
commit 8d00ca74fc

View File

@@ -513,13 +513,10 @@ impl MprisManager {
let player_iface = player_iface_ref.get().await;
loop {
tokio::select! {
Some(()) = rx.next() => {
let ctx = player_iface_ref.signal_context();
player_iface.playback_status_changed(ctx).await?;
player_iface.metadata_changed(ctx).await?;
}
}
rx.next().await;
let ctx = player_iface_ref.signal_context();
player_iface.playback_status_changed(ctx).await?;
player_iface.metadata_changed(ctx).await?;
}
}