Skip to content
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

avm1: Improve loops treatment in Sound.start #1853

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

relrelb
Copy link
Contributor

@relrelb relrelb commented Dec 5, 2020

The second argument of Sound.start, loops, can be greater than std::u16::MAX, but previously greater values were treated as 1.
Ideally, the solution is to respect those values, but since SoundInfo holds a u16, a short-term solution is to treat them as std::u16::MAX instead.

Extracted from #1445 since this commit is unrelated.

@Herschel
Copy link
Member

Herschel commented Dec 6, 2020

Thanks for splitting this out into a separate PR!

I guess we should verify if the loops count can actually be an i32 eventually -- I guess so since AS3 Sound.play takes an int parameter. Anyone want to make a .01 second test sound that we can test for 65536 loops? :-)

The second argument of Sound.start, loops, can be greater than
std::u16::MAX, but previously greater values were treated as 1.
Ideally, the solution is to respect those values, but since SoundInfo
holds a u16, a short-term solution is to treat them as std::u16::MAX
instead.
@Herschel
Copy link
Member

Herschel commented Dec 6, 2020

Fixed the min -> max, thanks for the PR!!

@Herschel Herschel merged commit 989bfb8 into ruffle-rs:master Dec 6, 2020
@relrelb relrelb deleted the sound_loop branch December 7, 2020 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants