mirror of
https://github.com/Genymobile/scrcpy
synced 2025-09-02 15:25:14 +00:00
Fix stream offset on audio buffer underflow
The `read` variable is in number of samples, while the offset must be in bytes. PR #4045 <https://github.com/Genymobile/scrcpy/pull/4045> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
@@ -107,7 +107,7 @@ sc_audio_player_sdl_callback(void *userdata, uint8_t *stream, int len_int) {
|
|||||||
// latency.
|
// latency.
|
||||||
LOGD("[Audio] Buffer underflow, inserting silence: %" PRIu32 " samples",
|
LOGD("[Audio] Buffer underflow, inserting silence: %" PRIu32 " samples",
|
||||||
silence);
|
silence);
|
||||||
memset(stream + read, 0, TO_BYTES(silence));
|
memset(stream + TO_BYTES(read), 0, TO_BYTES(silence));
|
||||||
|
|
||||||
if (ap->received) {
|
if (ap->received) {
|
||||||
// Inserting additional samples immediately increases buffering
|
// Inserting additional samples immediately increases buffering
|
||||||
|
Reference in New Issue
Block a user