adityabugalia / aacdecoder-android

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

com.spoledge.aacdecoder.PCMFeed.run(PCMFeed.java:420) #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I don't know

java.lang.NullPointerException
at com.spoledge.aacdecoder.PCMFeed.run(PCMFeed.java:420)
at java.lang.Thread.run(Thread.java:856)

I have this error on some occasions and on different devices

Original issue reported on code.google.com by Akir...@gmail.com on 9 Sep 2014 at 4:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Same problem.
I figured out that this error only occurs when native method
   protected native int nativeStart( int decoder, BufferReader reader, Info info ) of class Decoder.
determines the wrong Samplerate. this happens rarely.

As a consequence, the AudioTrack constructor throws 
java.lang.IllegalArgumentException: Invalid audio buffer size.

Below a Logcat piece.
Determined samplerate is 11025, but shoud be 44100

03-19 11:22:16.465 D/AACPlayer( 8594): Declared bitrate is 128 kb/s
03-19 11:22:16.465 I/MultiPlayer( 8594): Setting MP3 decoder for content type 
audio/mpeg
03-19 11:22:16.465 I/AACPlayer( 8594): The dynamic metainfo is sent every 32768 
bytes
03-19 11:22:16.485 D/BufferReader( 8594): init(): capacity=11200
03-19 11:22:16.485 I/Decoder ( 8594): start() starting native decoder - 
OpenCORE-MP3
03-19 11:22:16.485 D/BufferReader( 8594): next() waiting....
03-19 11:22:16.485 D/BufferReader( 8594): run() started....
03-19 11:22:16.515 D/BufferReader( 8594): next() awaken
03-19 11:22:16.515 D/AACPlayer( 8594): play(): samplerate=11025, channels=2
03-19 11:22:16.525 D/AACPlayer( 8594): First samples length: 1152
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=10671, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=9647, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=8623, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=7599, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=6575, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=5551, 
status=2
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.525 E/Decoder[OpenCORE-MP3]( 8594): decode() bytesleft=4527, 
status=1
03-19 11:22:16.525 W/Decoder ( 8594): decode() failed to decode a frame
03-19 11:22:16.535 D/AACPlayer( 8594): play(): decoded 13824 samples
03-19 11:22:16.535 D/PCMFeed ( 8594): run(): sampleRate=11025, channels=2, 
bufferSizeInBytes=66150 (1500 ms)
03-19 11:22:16.535 E/PCMFeed ( 8594): Cannot create AudioTrack: 
java.lang.IllegalArgumentException: Invalid audio buffer size.
03-19 11:22:16.535 I/Decoder ( 8594): stop() stopping native decoder
03-19 11:22:16.535 I/AACPlayer( 8594): play(): average decoding time: 3 ms
03-19 11:22:16.535 I/AACPlayer( 8594): play(): average rate (samples/sec): 
audio=22050, decoding=4608000, audio/decoding= 20797 %  (the higher, the 
better; negative means that decoding is slower than needed by audio)
03-19 11:22:16.545 W/dalvikvm( 8594): threadid=15: thread exiting with uncaught 
exception (group=0x4200f2a0)
03-19 11:22:16.545 E/ACRA    ( 8594): java.lang.NullPointerException
03-19 11:22:16.545 E/ACRA    ( 8594):   at 
com.spoledge.aacdecoder.PCMFeed.run(Unknown Source)
03-19 11:22:16.545 E/ACRA    ( 8594):   at java.lang.Thread.run(Thread.java:856)

Original comment by thomasp...@googlemail.com on 19 Mar 2015 at 11:40