aacdecoder-android icon indicating copy to clipboard operation
aacdecoder-android copied to clipboard

Zombie players if players are rapidly created, played and stopped.

Open GoogleCodeExporter opened this issue 9 years ago • 9 comments

What steps will reproduce the problem?
1. Create new AACPlayer
2. Set URL with AACPlayer.playAsync()
3. Stop player with AACPlayer.stop()
4. Repeat 1-3 in quick succession

Expect only one player active at any given time but is experiencing "zombie 
players" where a player keeps playing, after AACPlayer.stop() is called. 
BufferReader, PCMFeed and AACPlayer all have "active threads" that doesn't exit 
and clean up. With enough zombie players allocating new AudioTrack objects will 
fail to initialize.


Observed with v 0.8 of library on a number of devices and emulator setups.

What is the URL of the stream ?
Varies, but always AAC.

Please provide any additional information below.
Fix implemented in attached PCMFeed.java and AACPlayer.java:
- AACPlayer
-- Added synchronized clauses around AACPlayer's stop method and stopped field.
-- 
- PCMFeed
-- Added early detection of AudioTrack being in an unusable state.
-- Protected calls to AudioTrack.pause() if track is not in a usuable state.

Original issue reported on code.google.com by [email protected] on 15 May 2014 at 3:43

Attachments:

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

[deleted comment]

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

I have the same problem ?
Did you find a solution please !! i'm completly stuck.
thanks !

Original comment by [email protected] on 19 Jan 2015 at 4:10

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

Look at the attached files, replace the original code with these two and the 
problem should be solved.

Original comment by [email protected] on 19 Jan 2015 at 4:13

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

I'm using the jar file shoud i compile a new one !
if you have one please send me !
Thanks

Original comment by [email protected] on 21 Jan 2015 at 11:21

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

Yes, you need to !

Original comment by [email protected] on 21 Jan 2015 at 11:22

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

i made it thanks ! hope it works fine now
Thank again !

Original comment by [email protected] on 22 Jan 2015 at 12:25

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

I have the same trouble.
if you please send me one it would be great ;P
(I'm a new and never compile with java)

Original comment by [email protected] on 3 Feb 2015 at 8:46

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

Hi,sorry for being late ! here is the new compiled version !


Original comment by [email protected] on 21 Feb 2015 at 10:47

Attachments:

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter

Thanks man ;)

Original comment by [email protected] on 3 Mar 2015 at 8:16

GoogleCodeExporter avatar Mar 18 '15 08:03 GoogleCodeExporter