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:
parent
4c4a03ebe1
commit
b2d860382f
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue