summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-08 16:03:10 -0700
committerChong Zhang <chz@google.com>2015-03-09 14:57:31 -0700
commit5bb7e181d9156135e56ce44a3d0bd42eb31a9ee8 (patch)
treed3fecff61b1eb4de3a848e4be960062f2a9486d2 /media
parentb4f18f964cba9f124e5a264428290ada6eb4aa00 (diff)
downloadframeworks_av-5bb7e181d9156135e56ce44a3d0bd42eb31a9ee8.zip
frameworks_av-5bb7e181d9156135e56ce44a3d0bd42eb31a9ee8.tar.gz
frameworks_av-5bb7e181d9156135e56ce44a3d0bd42eb31a9ee8.tar.bz2
AnotherPacketSource: return format of first non-discontinuity packet
bug: 19656539 Change-Id: I41a36a48274616c3a65a79bf8446eeadb5595915
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/mpeg2ts/AnotherPacketSource.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
index f266fe7..bb05417 100644
--- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
+++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
@@ -91,13 +91,11 @@ sp<MetaData> AnotherPacketSource::getFormat() {
while (it != mBuffers.end()) {
sp<ABuffer> buffer = *it;
int32_t discontinuity;
- if (buffer->meta()->findInt32("discontinuity", &discontinuity)) {
- break;
- }
-
- sp<RefBase> object;
- if (buffer->meta()->findObject("format", &object)) {
- return mFormat = static_cast<MetaData*>(object.get());
+ if (!buffer->meta()->findInt32("discontinuity", &discontinuity)) {
+ sp<RefBase> object;
+ if (buffer->meta()->findObject("format", &object)) {
+ return mFormat = static_cast<MetaData*>(object.get());
+ }
}
++it;