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

Commit 2a66207f authored by Apurupa Pattapu's avatar Apurupa Pattapu Committed by Lajos Molnar
Browse files

httplive: Create a copy of last enqueued metadata

Create duplicate of metadata in queueAccessUnit so that it is
available even after all the buffers are erased from packet source.

During a bandwidth switch httplive streaming Source uses last
enqueued timestamp as the start time for the new streams, and this
switch can occur at a time when all the packets are dequeued from
the current packet source. This is one of the scenarios when the
last enqueued time was showing a invalid timestamp. Creating a
copy will retain the timestamp value until the packet source is
active.

Bug: 18821145
Change-Id: I4d4ee700705cee58773da4660f8769f56018f9e4
parent 17460976
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -218,12 +218,12 @@ void AnotherPacketSource::queueAccessUnit(const sp<ABuffer> &buffer) {
    }

    if (mLatestEnqueuedMeta == NULL) {
        mLatestEnqueuedMeta = buffer->meta();
        mLatestEnqueuedMeta = buffer->meta()->dup();
    } else {
        int64_t latestTimeUs = 0;
        CHECK(mLatestEnqueuedMeta->findInt64("timeUs", &latestTimeUs));
        if (lastQueuedTimeUs > latestTimeUs) {
            mLatestEnqueuedMeta = buffer->meta();
            mLatestEnqueuedMeta = buffer->meta()->dup();
        }
    }
}