From 8d2efe75ae8a18acc2da7bedb807a76afa83d8b7 Mon Sep 17 00:00:00 2001 From: Mark Kuo Date: Thu, 19 Sep 2019 15:28:33 +1000 Subject: [PATCH] Fix VideostreamGDNative audio buffer handling Fix the audio buffer start when there are previous remains --- modules/gdnative/videodecoder/video_stream_gdnative.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index be131c54021..212ff51b807 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -149,7 +149,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) { if (mix_callback) { if (pcm_write_idx >= 0) { // Previous remains - int mixed = mix_callback(mix_udata, pcm, samples_decoded); + int mixed = mix_callback(mix_udata, pcm + pcm_write_idx * num_channels, samples_decoded); if (mixed == samples_decoded) { pcm_write_idx = -1; } else {