summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OggExtractor.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-08-05 10:00:10 -0700
committerAndreas Huber <andih@google.com>2010-08-05 10:00:10 -0700
commitecaccb9f82dd07b29aa32ce36e8d15862dfdf547 (patch)
treeb981bd94a1437fe5aa45539be2e84c05ac7b9483 /media/libstagefright/OggExtractor.cpp
parent9cf3ce33d626543bd749241d0280f3900d5b8ed3 (diff)
downloadframeworks_av-ecaccb9f82dd07b29aa32ce36e8d15862dfdf547.zip
frameworks_av-ecaccb9f82dd07b29aa32ce36e8d15862dfdf547.tar.gz
frameworks_av-ecaccb9f82dd07b29aa32ce36e8d15862dfdf547.tar.bz2
A better fix for the OggExtractor referring to the sample rate while it hasn't been initialized yet.
Change-Id: I001fa36d3f5bf385b9f9d086c802673071c65db9 related-to-bug: 2896814
Diffstat (limited to 'media/libstagefright/OggExtractor.cpp')
-rw-r--r--media/libstagefright/OggExtractor.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/media/libstagefright/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp
index 16f094b..641a876 100644
--- a/media/libstagefright/OggExtractor.cpp
+++ b/media/libstagefright/OggExtractor.cpp
@@ -361,11 +361,17 @@ status_t MyVorbisExtractor::readNextPacket(MediaBuffer **out) {
memcpy(tmp->data(), buffer->data(), buffer->range_length());
tmp->set_range(0, buffer->range_length());
buffer->release();
- } else if (mVi.rate) {
+ } else {
// XXX Not only is this not technically the correct time for
// this packet, we also stamp every packet in this page
// with the same time. This needs fixing later.
- timeUs = mCurrentPage.mGranulePosition * 1000000ll / mVi.rate;
+
+ if (mVi.rate) {
+ // Rate may not have been initialized yet if we're currently
+ // reading the configuration packets...
+ // Fortunately, the timestamp doesn't matter for those.
+ timeUs = mCurrentPage.mGranulePosition * 1000000ll / mVi.rate;
+ }
tmp->set_range(0, 0);
}
buffer = tmp;