Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't stop audio streams in run_frame_internal to prevent audio stutter. Close #3817 #3819

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 1 addition & 10 deletions core/src/display_object/movie_clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,6 @@ impl<'gc> MovieClip<'gc> {
let tag_stream_start = mc.static_data.swf.as_ref().as_ptr() as u64;
let data = mc.static_data.swf.clone();
let mut reader = data.read_from(mc.tag_stream_pos);
let mut has_stream_block = false;
drop(mc);

let vm_type = self.vm_type(context);
Expand All @@ -1073,22 +1072,14 @@ impl<'gc> MovieClip<'gc> {
TagCode::RemoveObject2 if run_display_actions => self.remove_object(context, reader, 2),
TagCode::SetBackgroundColor => self.set_background_color(context, reader),
TagCode::StartSound => self.start_sound_1(context, reader),
TagCode::SoundStreamBlock => {
has_stream_block = true;
self.sound_stream_block(context, reader)
}
TagCode::SoundStreamBlock => self.sound_stream_block(context, reader),
_ => Ok(()),
};
let _ = tag_utils::decode_tags(&mut reader, tag_callback, TagCode::ShowFrame);

self.0.write(context.gc_context).tag_stream_pos =
reader.get_ref().as_ptr() as u64 - tag_stream_start;

// If we are playing a streaming sound, there should(?) be a `SoundStreamBlock` on each frame.
if !has_stream_block {
self.0.write(context.gc_context).stop_audio_stream(context);
}

let frame_id = self.0.read().current_frame;
self.0.write(context.gc_context).queued_script_frame = Some(frame_id);
}
Expand Down