Skip to content

Commit

Permalink
Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 16, 2018
1 parent 0d3d28c commit 6d45b0d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/SDL_sound.c
Expand Up @@ -404,15 +404,14 @@ static int init_sample(const Sound_DecoderFunctions *funcs,

/* Now we need to set up the conversion buffer... */

SDL_memcpy(&desired, (_desired != NULL) ? _desired : &sample->actual,
sizeof (Sound_AudioInfo));

if (desired.format == 0)
desired.format = sample->actual.format;
if (desired.channels == 0)
desired.channels = sample->actual.channels;
if (desired.rate == 0)
desired.rate = sample->actual.rate;
if (_desired == NULL)
SDL_memcpy(&desired, &sample->actual, sizeof (Sound_AudioInfo));
else
{
desired.format = _desired->format ? _desired->format : sample->actual.format;
desired.channels = _desired->channels ? _desired->channels : sample->actual.channels;
desired.rate = _desired->rate ? _desired->rate : sample->actual.rate;
} /* else */

if (SDL_BuildAudioCVT(&internal->sdlcvt,
sample->actual.format,
Expand Down

0 comments on commit 6d45b0d

Please sign in to comment.