Browse Source

Merge pull request #32198 from starryalley/fix_audio_buffer

Fix VideostreamGDNative audio buffer handling
Rémi Verschelde 5 years ago
parent
commit
30e16fff57
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/gdnative/videodecoder/video_stream_gdnative.cpp

+ 1 - 1
modules/gdnative/videodecoder/video_stream_gdnative.cpp

@@ -149,7 +149,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) {
 	if (mix_callback) {
 	if (mix_callback) {
 		if (pcm_write_idx >= 0) {
 		if (pcm_write_idx >= 0) {
 			// Previous remains
 			// 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) {
 			if (mixed == samples_decoded) {
 				pcm_write_idx = -1;
 				pcm_write_idx = -1;
 			} else {
 			} else {