-
-
Notifications
You must be signed in to change notification settings - Fork 944
avm1: implemented getBytesLoaded and getBytesTotal #22612
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
base: master
Are you sure you want to change the base?
Conversation
How did you find that? Have you tried playing a 5 GB sound? |
Yes, that's exactly how I did it. |
|
You can add a TODO for the u64 total bytes stuff. |
9676b3e to
721dc10
Compare
|
I was sleeping I think. My u64 should have been a u32 instead of the other way around. Has been changed in the last commit |
| ) -> Result<Value<'gc>, Error<'gc>> { | ||
| avm1_stub!(activation, "Sound", "getBytesLoaded"); | ||
| Ok(1.into()) | ||
| if activation.swf_version() >= 6 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is VERSION_6 so this if does nothing?
| ) -> Result<Value<'gc>, Error<'gc>> { | ||
| avm1_stub!(activation, "Sound", "getBytesTotal"); | ||
| Ok(1.into()) | ||
| if activation.swf_version() >= 6 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is VERSION_6 so this if does nothing?
core/src/avm1/globals/sound.rs
Outdated
| if let NativeObject::Sound(sound) = this.native() { | ||
| if let Some(sound_handle) = sound.sound() { | ||
| if let Some(length) = activation.context.audio.get_sound_size(sound_handle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you invert those ifs you can reduce indentation
So it shouldn't be 64-bit? |
core/src/avm1/globals/sound.rs
Outdated
| return Ok(length.into()); | ||
| } | ||
| } | ||
| return Ok(1.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it return 1 here?
W.I.P