diff options
author | Andreas Huber <andih@google.com> | 2010-12-22 10:03:04 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-12-22 10:03:04 -0800 |
commit | 53df1a460bcfdd129ca2bc416dee2009e35c042e (patch) | |
tree | ab7d4a70f4a09211ba62f4725c7eb735ccf10587 /media/libstagefright/mpeg2ts/AnotherPacketSource.cpp | |
parent | df42f949c8bd05b81d94633767514fff88f52062 (diff) | |
download | frameworks_av-53df1a460bcfdd129ca2bc416dee2009e35c042e.zip frameworks_av-53df1a460bcfdd129ca2bc416dee2009e35c042e.tar.gz frameworks_av-53df1a460bcfdd129ca2bc416dee2009e35c042e.tar.bz2 |
Distinguish discontinuities w/ a format change from those without.
Shutdown decoders as needed in anticipation of a format change, otherwise just flush.
Change-Id: Ieb04f8aa8658569b091409c4903075fd496e5abb
Diffstat (limited to 'media/libstagefright/mpeg2ts/AnotherPacketSource.cpp')
-rw-r--r-- | media/libstagefright/mpeg2ts/AnotherPacketSource.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp index 7a1d5b0..a8fe2c1 100644 --- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp @@ -63,8 +63,6 @@ status_t AnotherPacketSource::dequeueAccessUnit(sp<ABuffer> *buffer) { int32_t discontinuity; if ((*buffer)->meta()->findInt32("discontinuity", &discontinuity) && discontinuity) { - buffer->clear(); - return INFO_DISCONTINUITY; } @@ -125,10 +123,14 @@ void AnotherPacketSource::queueAccessUnit(const sp<ABuffer> &buffer) { mCondition.signal(); } -void AnotherPacketSource::queueDiscontinuity() { +void AnotherPacketSource::queueDiscontinuity(bool formatChange) { sp<ABuffer> buffer = new ABuffer(0); buffer->meta()->setInt32("discontinuity", true); + if (formatChange) { + buffer->meta()->setInt32("format-change", true); + } + Mutex::Autolock autoLock(mLock); mBuffers.push_back(buffer); |