Skip to content

Commit

Permalink
pcm: fix incorrect process_buffer params
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Dec 23, 2024
1 parent d6696e4 commit ffbf0db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/pcm_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,15 @@ static void process_audio(SDL_AudioCVT *cvt, Uint8 *data, size_t *data_size) {
converted_size = chunk_size;
}

debugfn("Data size: %d", *data_size);

// Accumulate data into the final output
memcpy(data + *data_size, conv_buffer, converted_size);
*data_size += converted_size;

// Update pointers/counters
curr_data += chunk_size;
remaining -= chunk_size;
process_pcm_buffer(conv_buffer, converted_size);
process_pcm_buffer(data, *data_size);
debugfn("Data size: %d", *data_size);
}

free(stream);
Expand Down

0 comments on commit ffbf0db

Please sign in to comment.