Skip to content

Commit

Permalink
fix sound errors on resume after pressing home button
Browse files Browse the repository at this point in the history
  • Loading branch information
badda71 committed May 27, 2020
1 parent 5ba64e1 commit d5accd4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/common/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ static void fill_buffer(int size, int rise)

i = snddata.playdev->write(p, size * snddata.sound_output_channels);
if (i) {
sound_error("write to sound device failed.");
sound_error("write to sound device failed (1)");
}
}

Expand Down Expand Up @@ -1443,13 +1443,17 @@ double sound_flush()
if (nr) {
/* Flush buffer, all channels are already mixed into it. */
if (snddata.playdev->write(snddata.buffer, nr * snddata.sound_output_channels)) {
sound_error("write to sound device failed.");
// this happens a lot on 3ds
// do not show an error but rather re-init sound
// sound_error("write to sound device failed (2)");
sound_close();
set_playback_enabled(1, NULL);
return 0;
}

if (snddata.recdev) {
if (snddata.recdev->write(snddata.buffer, nr * snddata.sound_output_channels)) {
sound_error("write to sound device failed.");
sound_error("write to sound device failed (3)");
return 0;
}
}
Expand Down

0 comments on commit d5accd4

Please sign in to comment.