From 52d940b8decbbdebe068c053683472f13b63c10d Mon Sep 17 00:00:00 2001 From: David Wendt Date: Tue, 22 Aug 2023 23:25:02 -0400 Subject: [PATCH] core: Rename `init_buffer` to `reset_buffer` --- core/src/loader.rs | 2 +- core/src/streams.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/loader.rs b/core/src/loader.rs index 0e512ad0df25..3f33b16140ce 100644 --- a/core/src/loader.rs +++ b/core/src/loader.rs @@ -1392,7 +1392,7 @@ impl<'gc> Loader<'gc> { match response { Ok(mut response) => { - stream.init_buffer(uc); + stream.reset_buffer(uc); stream.load_buffer(uc, &mut response.body); } Err(response) => { diff --git a/core/src/streams.rs b/core/src/streams.rs index 902dabd31884..4ad21dcebe83 100644 --- a/core/src/streams.rs +++ b/core/src/streams.rs @@ -239,7 +239,7 @@ pub struct NetStreamData<'gc> { impl<'gc> NetStream<'gc> { pub fn new(gc_context: &Mutation<'gc>, avm_object: Option>) -> Self { // IMPORTANT: When adding new fields consider if they need to be - // initialized in `init_buffer` as well. + // initialized in `reset_buffer` as well. Self(GcCell::new( gc_context, NetStreamData { @@ -271,15 +271,15 @@ impl<'gc> NetStream<'gc> { self.0.write(gc_context).avm_object = Some(avm_object); } - /// Initialize the `NetStream` buffer to accept new source data. + /// Reset the `NetStream` buffer to accept new source data. /// /// This must be done once per source change and should ideally be done /// immediately before the first `load_buffer` call for a particular source /// file. /// - /// Externally visible AVM state must not be initialized here - i.e. the + /// Externally visible AVM state must not be reinitialized here - i.e. the /// AS3 `client` doesn't go away because you played a new video file. - pub fn init_buffer(self, context: &mut UpdateContext<'_, 'gc>) { + pub fn reset_buffer(self, context: &mut UpdateContext<'_, 'gc>) { let mut write = self.0.write(context.gc_context); if let Some(instance) = write.sound_instance {