You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
Fixes VideostreamGDNative crash on audio_channel=0.
Added an if case to check if the mix_callback exists before running any
of the audio code.
Fixes: #28644
(cherry picked from commit f0757f31a4)
This commit is contained in:
@@ -146,6 +146,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) {
|
|||||||
ERR_FAIL_COND(interface == NULL);
|
ERR_FAIL_COND(interface == NULL);
|
||||||
interface->update(data_struct, p_delta);
|
interface->update(data_struct, p_delta);
|
||||||
|
|
||||||
|
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, samples_decoded);
|
||||||
@@ -165,6 +166,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) {
|
|||||||
samples_decoded -= pcm_write_idx;
|
samples_decoded -= pcm_write_idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (interface->get_playback_position(data_struct) < time && playing) {
|
while (interface->get_playback_position(data_struct) < time && playing) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user