rodrigoti / aacdecoder-android

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

Some data is lost and media time is shorter around 1 second than what it should be #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I am just using the aacdecoder lib.
1. I feed data into InputStream such as 100KB.
2. I calculate the total consumed bytes as totalBytes += 
info.getRoundBytesConsumed()
3. Compare the two result after the song is completed. The total consumed bytes 
are less than what I feed such just 90kb. The result is AudioTrack always 
returns shorter mediatime. For example, I can calucate the overall mediatime is 
20seconds by using file size and Bitrate. The AudioTrack returns just 19 
seconds.

What is the expected output? What do you see instead?
Decoder should send all the data to AudioTrack? Is there another way to keep 
the value consistent? 

What version of the product are you using? On which device ?
    aacdecoder-android-libs-0.6.1.zip 

What is the URL of the stream ?
        Any stream. 

Please provide any additional information below.

Original issue reported on code.google.com by Liu.Bin....@gmail.com on 24 Sep 2013 at 12:47

GoogleCodeExporter commented 9 years ago
The reason is that decoder consumes some data from the beginning of the stream: 
searching for sync word and decoding the first frame to prove it is the correct 
stream start and to read stream parameters.

So it is not 10% of the whole length but rather a constant - my measurement:
File size 44720 -->  decoded 43483 bytes
File size 270336 --> decoded 269095 bytes

Original comment by vbarta...@gmail.com on 10 Jan 2014 at 9:00

GoogleCodeExporter commented 9 years ago
revision 42 - the first frame is also being played.

Original comment by vbarta...@gmail.com on 11 Jan 2014 at 2:00

GoogleCodeExporter commented 9 years ago
included in version 0.8

Original comment by vbarta...@gmail.com on 12 Jan 2014 at 8:17