Skip to content

Commit

Permalink
Remove hopefully unneeded memcpy in movie sound callback (if SDL_Audi…
Browse files Browse the repository at this point in the history
…oStreamGet fails, I'm hopeing the buffer remains empty)
  • Loading branch information
dashodanger committed Nov 12, 2023
1 parent bf8f9e7 commit 0374da2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
File renamed without changes.
7 changes: 1 addition & 6 deletions source_files/edge/i_sound.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ void SoundFill_Callback(void *udata, Uint8 *stream, int len)
{
int avail = MIN(SDL_AudioStreamAvailable(movie_audiostream), len);
if (avail > 0)
{
s16_t *buf = new s16_t[avail];
int length = SDL_AudioStreamGet(movie_audiostream, buf, avail);
if (length > 0)
memcpy(stream, buf, length);
}
SDL_AudioStreamGet(movie_audiostream, stream, avail);
}
else
S_MixAllChannels(stream, len);
Expand Down

0 comments on commit 0374da2

Please sign in to comment.