summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-07-27 17:02:53 -0700
committerRobert Shih <robertshih@google.com>2015-07-29 11:22:15 -0700
commit7f3bb5ad9dfb30388b69166e58391ff3aa6f00a3 (patch)
tree89c8f5917ec89d12313fce7db41fd3a61e6f10b7 /media/libstagefright/httplive
parent6134ad6fdeab91e54a1abc8f00eafc956e42fb3d (diff)
downloadframeworks_av-7f3bb5ad9dfb30388b69166e58391ff3aa6f00a3.zip
frameworks_av-7f3bb5ad9dfb30388b69166e58391ff3aa6f00a3.tar.gz
frameworks_av-7f3bb5ad9dfb30388b69166e58391ff3aa6f00a3.tar.bz2
HLS: preserve old format in onChangeConfiguration2
`onChangeConfiguration2` is only called during seek. Bug: 22698650 Change-Id: I715fa51d04d503f49d678eaea08f2b63dce4e01e
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 2fc5135..1557401 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -1657,7 +1657,16 @@ void LiveSession::onChangeConfiguration2(const sp<AMessage> &msg) {
mLastDequeuedTimeUs = timeUs;
for (size_t i = 0; i < mPacketSources.size(); i++) {
- mPacketSources.editValueAt(i)->clear();
+ sp<AnotherPacketSource> packetSource = mPacketSources.editValueAt(i);
+ sp<MetaData> format = packetSource->getFormat();
+ packetSource->clear();
+ // Set a tentative format here such that HTTPLiveSource will always have
+ // a format available when NuPlayer queries. Without an available video
+ // format when setting a surface NuPlayer might disable video decoding
+ // altogether. The tentative format will be overwritten by the
+ // authoritative (and possibly same) format once content from the new
+ // position is dequeued.
+ packetSource->setFormat(format);
}
for (size_t i = 0; i < kMaxStreams; ++i) {