Fix the pause() method toggling pause state for VLC backend

This method should pause the audio. Instead, the VLC backend would
toggle the pause state, i.e. it would start playing again if the audio
stream was already paused.  This caused issues with already paused
streams incorrectly resuming playback after the system woke up from
suspend.

BUG: 474432
This commit is contained in:
Bart De Vries 2024-01-23 22:16:00 +01:00
parent 7f7901b2bd
commit 973a5b7ac9
1 changed files with 6 additions and 1 deletions

View File

@ -368,7 +368,12 @@ void VlcMediaBackend::pause()
return; return;
} }
// need to check playback state first, because the pause function will
// actually toggle pause, i.e. it will start playing when the current track
// has already been paused
if (playbackState() == KMediaSession::PlaybackState::PlayingState) {
libvlc_media_player_pause(d->mPlayer); libvlc_media_player_pause(d->mPlayer);
}
} }
void VlcMediaBackend::stop() void VlcMediaBackend::stop()