[XMP] Fixed issues with lack of state change and premature audio cut

This commit is contained in:
Gliniak 2024-11-02 18:51:15 +01:00
parent 3ac98ebfba
commit 35cc2ccd7a
1 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ void AudioMediaPlayer::Play() {
// We need to stop playback only if it wasn't // We need to stop playback only if it wasn't
if (result != ProcessAudioResult::ForcedFinish) { if (result != ProcessAudioResult::ForcedFinish) {
Stop(); Stop(true, true);
} }
// We're waiting for dangling samples to finish playing. // We're waiting for dangling samples to finish playing.
@ -270,10 +270,10 @@ void AudioMediaPlayer::Play() {
avio_context_free(&formatContext->pb); avio_context_free(&formatContext->pb);
avformat_close_input(&formatContext); avformat_close_input(&formatContext);
DeleteDriver();
processing_end_fence_.Signal(); processing_end_fence_.Signal();
if (result == ProcessAudioResult::ForcedFinish) { if (result == ProcessAudioResult::ForcedFinish) {
DeleteDriver();
return; return;
} }