summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/foundation
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-12-08 12:27:47 -0800
committerAndreas Huber <andih@google.com>2011-12-08 12:27:47 -0800
commit1906e5c7492b9cbc88601365536a69e9a490c963 (patch)
treee6cb486b8987b716312076a28c695c10115fe61a /media/libstagefright/foundation
parent894f3ca9a9f94225bb64f36847508a91d0b17a6e (diff)
downloadframeworks_av-1906e5c7492b9cbc88601365536a69e9a490c963.zip
frameworks_av-1906e5c7492b9cbc88601365536a69e9a490c963.tar.gz
frameworks_av-1906e5c7492b9cbc88601365536a69e9a490c963.tar.bz2
Fix Bitreader "putBits" implementation, make sure we emulate timestamps
if we don't receive npt time mapping from the rtsp server (i.e. live stream) Change-Id: I5147d665bd90c9a303ad6ffdafbf770f930f917c related-to-bug: 5660357
Diffstat (limited to 'media/libstagefright/foundation')
-rw-r--r--media/libstagefright/foundation/ABitReader.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libstagefright/foundation/ABitReader.cpp b/media/libstagefright/foundation/ABitReader.cpp
index f07dd4f..5499c32 100644
--- a/media/libstagefright/foundation/ABitReader.cpp
+++ b/media/libstagefright/foundation/ABitReader.cpp
@@ -79,7 +79,13 @@ void ABitReader::skipBits(size_t n) {
}
void ABitReader::putBits(uint32_t x, size_t n) {
- CHECK_LE(mNumBitsLeft + n, 32u);
+ CHECK_LE(n, 32u);
+
+ while (mNumBitsLeft + n > 32) {
+ mNumBitsLeft -= 8;
+ --mData;
+ ++mSize;
+ }
mReservoir = (mReservoir >> n) | (x << (32 - n));
mNumBitsLeft += n;