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

Commit 5bb7e181 authored by Chong Zhang's avatar Chong Zhang
Browse files

AnotherPacketSource: return format of first non-discontinuity packet

bug: 19656539
Change-Id: I41a36a48274616c3a65a79bf8446eeadb5595915
parent b4f18f96
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -91,14 +91,12 @@ sp<MetaData> AnotherPacketSource::getFormat() {
    while (it != mBuffers.end()) {
        sp<ABuffer> buffer = *it;
        int32_t discontinuity;
        if (buffer->meta()->findInt32("discontinuity", &discontinuity)) {
            break;
        }

        if (!buffer->meta()->findInt32("discontinuity", &discontinuity)) {
            sp<RefBase> object;
            if (buffer->meta()->findObject("format", &object)) {
                return mFormat = static_cast<MetaData*>(object.get());
            }
        }

        ++it;
    }