Fix VideostreamGDNative audio buffer handling

Fix the audio buffer start when there are previous remains
This commit is contained in:
Mark Kuo 2019-09-19 15:28:33 +10:00
parent a1fcac6400
commit 8d2efe75ae

View File

@ -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 {