Skip to content

Commit

Permalink
Fix crash on videos with audio
Browse files Browse the repository at this point in the history
  • Loading branch information
EIREXE committed May 13, 2024
1 parent b2921a0 commit b609f1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ffmpeg_video_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void FFmpegVideoStreamPlayback::update_internal(double p_delta) {
List<Ref<DecodedAudioFrame>>::Element *next_audio_frame = available_audio_frames.front();
while (next_audio_frame && check_next_audio_frame_valid(next_audio_frame->get())) {
ZoneNamedN(__audio_mix, "Audio mix", true);
Ref<DecodedAudioFrame> audio_frame = next_frame->get();
Ref<DecodedAudioFrame> audio_frame = next_audio_frame->get();
int sample_count = audio_frame->get_sample_data().size() / decoder->get_audio_channel_count();
#ifdef GDEXTENSION
mix_audio(sample_count, audio_frame->get_sample_data(), 0);
Expand Down

0 comments on commit b609f1c

Please sign in to comment.