Skip to content

Commit

Permalink
core: Rename init_buffer to reset_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
kmeisthax committed Aug 23, 2023
1 parent 51c8799 commit 52d940b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions core/src/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub struct NetStreamData<'gc> {
impl<'gc> NetStream<'gc> {
pub fn new(gc_context: &Mutation<'gc>, avm_object: Option<AvmObject<'gc>>) -> 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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 52d940b

Please sign in to comment.