bugGnash - The GNU Flash player - Bugs: bug #35545, Gnash treats zero and negative...

 
 

bug #35545: Gnash treats zero and negative repeat value in Sound.start(offset,repeat) incorrectly

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Thu 16 Feb 2012 01:30:15 PM UTC
   
 
Category:  sound Severity:  3 - Normal
Release:  0.8.9 Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 25 Jul 2013 12:35:49 AM UTC, comment #7: 

Fixed in e335377dd7; leaving this open in case anyone would like to make an automated testcase.

Bastiaan Jacques <bjacques>
Group Member
Wed 24 Jul 2013 10:36:19 PM UTC, comment #6: 

It might be possible to use the Sound.duration property to detect the number of loops, although avoiding timing problems would be tricky.

Bastiaan Jacques <bjacques>
Group Member
Tue 12 Jun 2012 05:53:06 PM UTC, comment #5: 

The self-contained testcase is not to confirm the bug.
The bug is confirmed.

The test is to help further understand the expected behavior, confirm the fix and avoid ever reintroducing it.

Sandro Santilli <strk>
Group Member
Wed 30 May 2012 02:25:20 PM UTC, comment #4: 

I think it's not just an testcase issue anymore.
I suspect that some flash game seemed to be affected by this too.

UFO Joe (Flash 6)
http://www.miniclip.com/games/ufo-joe/en/
(http://www.miniclip.com/games/ufo-joe/en/ufojoe_flash8.swf)
In this game, intro sound on each level will be looped, and if you get into landing or crashing, you will get their sound effect looped too.

Pest Attack (Flash 7)
http://www.madoo.com/games/PestAttack/
(http://www.madoo.com/games/PestAttack/index.swf)
In this game, when you swatted rat, swatting sound will be looped, if you swatted more than one time, it will sounded like a chaos.

Nutchanon Wetchasit <nachanon>
Tue 10 Apr 2012 03:46:53 AM UTC, comment #3: 

Sorry about that.  I didn't read carefully.

Non-positive repeat values should be treated as "repeat once" if the goal is to mimic Flash.

AJ G <nmodprime>
Tue 10 Apr 2012 02:09:46 AM UTC, comment #2: 

I recreated this from git master.

What is expected behavior for repeat 0, -1, and -2?

For 0 I imagine you expect Flash's behavior: repeat once.

AJ G <nmodprime>
Thu 16 Feb 2012 01:41:05 PM UTC, comment #1: 

Best bug report ever ! Thank you so much .
So, next step here would be producing a self-contained test.
Not an easy task, but we have a couple about sounds already.

Sandro Santilli <strk>
Group Member
Thu 16 Feb 2012 01:30:15 PM UTC, original submission:  

Hello, I have used Gnash 0.8.9 and Gnash 0.8.10 to play flash7 file that tries to invoke sound within ActionScript 2.0, by using this code

snd=new Sound(this);
snd.attachSound("beep-note");

trace("sound: starting (repeat 0)");
snd.start(0.0,0);

It supposed to play sound from offset '0.0' with repeat value '0' which Flash Player will treat it like a repeat value '1' (aka. play the sound once)

But on Gnash, it was treated as an infinite-looped sound, which was an incorrect behavior.

http://www.mediafire.com/download.php?v94sl7efynp80lf
This is a 'correct' result from Macromedia Flash Player 7
You will notice that sound was played only once.

http://www.mediafire.com/download.php?62p0gt95r6151od
This is a video result from Gnash 0.8.10
You will notice that sound was looped infinitely, and there was also a gap between loop, which seems to be a symptom of bug #24481 (ActionScript sound loop gap)

http://www.mediafire.com/download.php?5h7gl9zqyrv4z47
These are my dummy flash files (created from Flash MX 2004), accompanied with source code, and also attached here.
(These videos was recorded using soundrepeat.0.swf [SoundRepeat0.as], but other files will behave the same)


Note #1: both zero and negative repeat value was treated by Macromedia Flash Player as it was '1'.

Note #2: both zero and negative repeat value was treated by Gnash as it was an infinite repeat (any negative value will get the same video result as above)

Gnash: gnash_0.8.9-1~lenny and gnash_0.8.10-1~lenny from getgnash.org APT repository (both yield exactly same result)
System: Debian GNU/Linux 5.0 Lenny on i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #25071:  soundrepeat.zip added by nachanon (25KiB - application/zip - Dummy test flash files (Flash 7))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bjacques (Posted a comment)
  • -email is unavailable- added by nmodprime (Posted a comment)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-25 bjacques StatusConfirmed Fixed
    2012-06-12 strk CategoryNone sound
        StatusNone Confirmed
    2012-02-16 nachanon Attached File- Added soundrepeat.zip, #25071

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code