Skip to content

Commit

Permalink
fix audio pop when returning to a game
Browse files Browse the repository at this point in the history
  • Loading branch information
dborth committed Aug 23, 2018
1 parent 3eebfa8 commit cff2782
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion source/gcaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ void PlaySound( int32 *Buffer, int count )

void UpdateSampleRate(int rate)
{
samplerate = rate;
if(samplerate != rate) {
samplerate = rate;
FCEUI_Sound(samplerate);
}
}

void SetSampleRate()
Expand Down
2 changes: 0 additions & 2 deletions source/gcvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ ResetVideo_Emu ()
{
rmode = tvmodes[FCEUI_GetCurrentVidSystem(NULL, NULL)];
UpdateSampleRate(48220);
SetSampleRate();
}
else
{
Expand All @@ -648,7 +647,6 @@ ResetVideo_Emu ()
ResetFbWidth(512, rmode);

UpdateSampleRate(48130);
SetSampleRate();
}

SetupVideoMode(rmode); // reconfigure VI
Expand Down

0 comments on commit cff2782

Please sign in to comment.