Skip to content

Commit

Permalink
core/audio: Remove the now unused stream_handle parameter of start_st…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
torokati44 committed Nov 26, 2023
1 parent 2396088 commit 8ce95d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
10 changes: 2 additions & 8 deletions core/src/backend/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SoundHandle>,
clip_frame: u16,
clip_data: crate::tag_utils::SwfSlice,
handle: &swf::SoundStreamHead,
Expand Down Expand Up @@ -269,7 +267,6 @@ impl AudioBackend for NullAudioBackend {

fn start_stream(
&mut self,
_stream_handle: Option<SoundHandle>,
_clip_frame: u16,
_clip_data: crate::tag_utils::SwfSlice,
_handle: &swf::SoundStreamHead,
Expand Down Expand Up @@ -533,16 +530,13 @@ impl<'gc> AudioManager<'gc> {
pub fn start_stream(
&mut self,
audio: &mut dyn AudioBackend,
stream_handle: Option<SoundHandle>,
movie_clip: MovieClip<'gc>,
clip_frame: u16,
data: crate::tag_utils::SwfSlice,
stream_info: &swf::SoundStreamHead,
) -> Option<SoundInstanceHandle> {
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,
Expand Down
5 changes: 1 addition & 4 deletions core/src/backend/audio/mixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ impl AudioMixer {
/// Starts a timeline audio stream.
pub fn start_stream(
&mut self,
_stream_handle: Option<SoundHandle>,
_clip_frame: u16,
clip_data: SwfSlice,
stream_info: &swf::SoundStreamHead,
Expand Down Expand Up @@ -1090,13 +1089,11 @@ macro_rules! impl_audio_mixer_backend {
#[inline]
fn start_stream(
&mut self,
stream_handle: Option<SoundHandle>,
clip_frame: u16,
clip_data: $crate::tag_utils::SwfSlice,
stream_info: &swf::SoundStreamHead,
) -> Result<SoundInstanceHandle, DecodeError> {
self.$mixer
.start_stream(stream_handle, clip_frame, clip_data, stream_info)
self.$mixer.start_stream(clip_frame, clip_data, stream_info)
}

#[inline]
Expand Down
11 changes: 2 additions & 9 deletions core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,20 +311,13 @@ impl<'a, 'gc> UpdateContext<'a, 'gc> {

pub fn start_stream(
&mut self,
stream_handle: Option<SoundHandle>,
movie_clip: MovieClip<'gc>,
frame: u16,
data: crate::tag_utils::SwfSlice,
stream_info: &swf::SoundStreamHead,
) -> Option<SoundInstanceHandle> {
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) {
Expand Down
9 changes: 2 additions & 7 deletions core/src/display_object/movie_clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8ce95d7

Please sign in to comment.