Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e3c9e3b authored by Robert Shih's avatar Robert Shih Committed by Android Git Automerger
Browse files

am 9a750f1e: Merge "HLS: preserve old format in onChangeConfiguration2" into mnc-dev

* commit '9a750f1e':
  HLS: preserve old format in onChangeConfiguration2
parents 53137c21 9a750f1e
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -1657,7 +1657,16 @@ void LiveSession::onChangeConfiguration2(const sp<AMessage> &msg) {
        mLastDequeuedTimeUs = timeUs;
        mLastDequeuedTimeUs = timeUs;


        for (size_t i = 0; i < mPacketSources.size(); i++) {
        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) {
        for (size_t i = 0; i < kMaxStreams; ++i) {