From 8ce95d76fe3029ec954ccf08c78d53694b3db937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=96R=C3=96K=20Attila?= Date: Sun, 26 Nov 2023 01:44:18 +0100 Subject: [PATCH] core/audio: Remove the now unused stream_handle parameter of start_stream --- core/src/backend/audio.rs | 10 ++-------- core/src/backend/audio/mixer.rs | 5 +---- core/src/context.rs | 11 ++--------- core/src/display_object/movie_clip.rs | 9 ++------- 4 files changed, 7 insertions(+), 28 deletions(-) diff --git a/core/src/backend/audio.rs b/core/src/backend/audio.rs index 1a1a5d0adfa7..d00338cbc5d9 100644 --- a/core/src/backend/audio.rs +++ b/core/src/backend/audio.rs @@ -99,11 +99,9 @@ pub trait AudioBackend: Downcast { /// Starts playing a "stream" sound, which is an audio stream that is distributed /// among the frames of a Flash MovieClip. /// - /// NOTE: `stream_handle` and `clip_frame` are no longer used on any - /// backends. + /// NOTE: `clip_frame` is no longer used on any backend. fn start_stream( &mut self, - stream_handle: Option, clip_frame: u16, clip_data: crate::tag_utils::SwfSlice, handle: &swf::SoundStreamHead, @@ -269,7 +267,6 @@ impl AudioBackend for NullAudioBackend { fn start_stream( &mut self, - _stream_handle: Option, _clip_frame: u16, _clip_data: crate::tag_utils::SwfSlice, _handle: &swf::SoundStreamHead, @@ -533,16 +530,13 @@ impl<'gc> AudioManager<'gc> { pub fn start_stream( &mut self, audio: &mut dyn AudioBackend, - stream_handle: Option, movie_clip: MovieClip<'gc>, clip_frame: u16, data: crate::tag_utils::SwfSlice, stream_info: &swf::SoundStreamHead, ) -> Option { if self.sounds.len() < Self::MAX_SOUNDS { - let handle = audio - .start_stream(stream_handle, clip_frame, data, stream_info) - .ok()?; + let handle = audio.start_stream(clip_frame, data, stream_info).ok()?; let instance = SoundInstance { sound: None, instance: handle, diff --git a/core/src/backend/audio/mixer.rs b/core/src/backend/audio/mixer.rs index f6b18efa221e..db08b1e29171 100644 --- a/core/src/backend/audio/mixer.rs +++ b/core/src/backend/audio/mixer.rs @@ -554,7 +554,6 @@ impl AudioMixer { /// Starts a timeline audio stream. pub fn start_stream( &mut self, - _stream_handle: Option, _clip_frame: u16, clip_data: SwfSlice, stream_info: &swf::SoundStreamHead, @@ -1090,13 +1089,11 @@ macro_rules! impl_audio_mixer_backend { #[inline] fn start_stream( &mut self, - stream_handle: Option, clip_frame: u16, clip_data: $crate::tag_utils::SwfSlice, stream_info: &swf::SoundStreamHead, ) -> Result { - self.$mixer - .start_stream(stream_handle, clip_frame, clip_data, stream_info) + self.$mixer.start_stream(clip_frame, clip_data, stream_info) } #[inline] diff --git a/core/src/context.rs b/core/src/context.rs index 730e2d96647b..d9aa7a1815a2 100644 --- a/core/src/context.rs +++ b/core/src/context.rs @@ -311,20 +311,13 @@ impl<'a, 'gc> UpdateContext<'a, 'gc> { pub fn start_stream( &mut self, - stream_handle: Option, movie_clip: MovieClip<'gc>, frame: u16, data: crate::tag_utils::SwfSlice, stream_info: &swf::SoundStreamHead, ) -> Option { - self.audio_manager.start_stream( - self.audio, - stream_handle, - movie_clip, - frame, - data, - stream_info, - ) + self.audio_manager + .start_stream(self.audio, movie_clip, frame, data, stream_info) } pub fn set_sound_transforms_dirty(&mut self) { diff --git a/core/src/display_object/movie_clip.rs b/core/src/display_object/movie_clip.rs index 88f7975696cc..c216d11bc75a 100644 --- a/core/src/display_object/movie_clip.rs +++ b/core/src/display_object/movie_clip.rs @@ -4364,13 +4364,8 @@ impl<'gc, 'a> MovieClip<'gc> { .static_data .swf .to_start_and_end(mc.tag_stream_pos as usize, mc.tag_stream_len()); - let audio_stream = context.start_stream( - mc.static_data.audio_stream_handle, - self, - mc.current_frame(), - slice, - stream_info, - ); + let audio_stream = + context.start_stream(self, mc.current_frame(), slice, stream_info); drop(mc); self.0.write(context.gc_context).audio_stream = audio_stream; }