diff options
author | Marco Nelissen <marcone@google.com> | 2014-09-19 11:46:44 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2014-09-19 18:57:09 +0000 |
commit | ab7f4182d4d509733107622216db4dd128340185 (patch) | |
tree | 19588c176eff8186695d09ab411721c1431def1e /media/libstagefright/codecs/aacdec/SoftAAC2.h | |
parent | b0ed4e3e482cbdc2fa6c7853526597f4ae3f0972 (diff) | |
download | frameworks_av-ab7f4182d4d509733107622216db4dd128340185.zip frameworks_av-ab7f4182d4d509733107622216db4dd128340185.tar.gz frameworks_av-ab7f4182d4d509733107622216db4dd128340185.tar.bz2 |
Fix ringbuffer handling
Explicitly keep track of the number of samples in the ring buffer,
rather than inferring it from the difference between the read and
write pointer, since the latter cannot distinguish between a
completely full and a completely empty buffer.
Bug: 17582331
Change-Id: I24d16ce96710209b7457ffad7c4c60201451980f
Diffstat (limited to 'media/libstagefright/codecs/aacdec/SoftAAC2.h')
-rw-r--r-- | media/libstagefright/codecs/aacdec/SoftAAC2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.h b/media/libstagefright/codecs/aacdec/SoftAAC2.h index 9fcb598..c3e4459 100644 --- a/media/libstagefright/codecs/aacdec/SoftAAC2.h +++ b/media/libstagefright/codecs/aacdec/SoftAAC2.h @@ -85,10 +85,11 @@ private: short *mOutputDelayRingBuffer; int32_t mOutputDelayRingBufferWritePos; int32_t mOutputDelayRingBufferReadPos; + int32_t mOutputDelayRingBufferFilled; bool outputDelayRingBufferPutSamples(INT_PCM *samples, int numSamples); int32_t outputDelayRingBufferGetSamples(INT_PCM *samples, int numSamples); int32_t outputDelayRingBufferSamplesAvailable(); - int32_t outputDelayRingBufferSamplesLeft(); + int32_t outputDelayRingBufferSpaceLeft(); DISALLOW_EVIL_CONSTRUCTORS(SoftAAC2); }; |