ryanqq / aacdecoder-android

Automatically exported from code.google.com/p/aacdecoder-android
GNU Lesser General Public License v3.0
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 olanordm...@gmail.com on 15 May 2014 at 3:43

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have the same problem ?
Did you find a solution please !! i'm completly stuck.
thanks !

Original comment by soufi.ma...@gmail.com on 19 Jan 2015 at 4:10

GoogleCodeExporter commented 9 years ago
Look at the attached files, replace the original code with these two and the 
problem should be solved.

Original comment by sveinung...@gmail.com on 19 Jan 2015 at 4:13

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

Original comment by soufi.ma...@gmail.com on 21 Jan 2015 at 11:21

GoogleCodeExporter commented 9 years ago
Yes, you need to !

Original comment by sveinung...@gmail.com on 21 Jan 2015 at 11:22

GoogleCodeExporter commented 9 years ago
i made it thanks ! hope it works fine now
Thank again !

Original comment by soufi.ma...@gmail.com on 22 Jan 2015 at 12:25

GoogleCodeExporter commented 9 years ago
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 sepasgr...@gmail.com on 3 Feb 2015 at 8:46

GoogleCodeExporter commented 9 years ago
Hi,sorry for being late ! here is the new compiled version !

Original comment by soufi.ma...@gmail.com on 21 Feb 2015 at 10:47

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks man ;)

Original comment by sepasgr...@gmail.com on 3 Mar 2015 at 8:16