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

Commit 976d139b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [4647037, 4647038, 4647883, 4647039, 4647933, 4648530,...

Merge cherrypicks of [4647037, 4647038, 4647883, 4647039, 4647933, 4648530, 4648550, 4648551, 4648552, 4648553, 4646931, 4646932, 4646933, 4646934, 4648391, 4647976, 4647977, 4647978, 4647526, 4646972, 4646935, 4646936, 4646937, 4646938, 4646939, 4646940, 4646941, 4648392, 4647509, 4648630, 4648631, 4647934] into pi-release-2

Change-Id: I8cdea65a2ac0ea4a5bea0107728de40127a4ae76
parents 8d3bfcbb 2870acaa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -247,8 +247,9 @@ MediaBufferBase* MidiEngine::readBuffer() {
        EAS_I32 numRendered;
        EAS_RESULT result = EAS_Render(mEasData, p, mEasConfig->mixBufferSize, &numRendered);
        if (result != EAS_SUCCESS) {
            ALOGE("EAS_Render returned %ld", result);
            break;
            ALOGE("EAS_Render() returned %ld, numBytesOutput = %d", result, numBytesOutput);
            buffer->release();
            return NULL; // Stop processing to prevent infinite loops.
        }
        p += numRendered * mEasConfig->numChannels;
        numBytesOutput += numRendered * mEasConfig->numChannels * sizeof(EAS_PCM);
+26 −11
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ struct M3UParser::MediaGroup : public RefBase {
            const char *language,
            uint32_t flags);

    bool getActiveURI(AString *uri) const;
    bool getActiveURI(AString *uri, const char *baseURL) const;

    void pickRandomMediaItems();
    status_t selectTrack(size_t index, bool select);
@@ -76,6 +76,7 @@ private:
        AString mURI;
        AString mLanguage;
        uint32_t mFlags;
        AString makeURL(const char *baseURL) const;
    };

    Type mType;
@@ -228,12 +229,16 @@ sp<AMessage> M3UParser::MediaGroup::getTrackInfo(size_t index) const {
    return format;
}

bool M3UParser::MediaGroup::getActiveURI(AString *uri) const {
bool M3UParser::MediaGroup::getActiveURI(AString *uri, const char *baseURL) const {
    for (size_t i = 0; i < mMediaItems.size(); ++i) {
        if (mSelectedIndex >= 0 && i == (size_t)mSelectedIndex) {
            const Media &item = mMediaItems.itemAt(i);

            *uri = item.mURI;
            if (item.mURI.empty()) {
                *uri = "";
            } else {
                *uri = item.makeURL(baseURL);
            }
            return true;
        }
    }
@@ -322,7 +327,7 @@ bool M3UParser::itemAt(size_t index, AString *uri, sp<AMessage> *meta) {
    }

    if (uri) {
        *uri = mItems.itemAt(index).mURI;
        *uri = mItems.itemAt(index).makeURL(mBaseURI.c_str());
    }

    if (meta) {
@@ -428,7 +433,7 @@ bool M3UParser::getTypeURI(size_t index, const char *key, AString *uri) const {
    AString groupID;
    if (!meta->findString(key, &groupID)) {
        if (uri != NULL) {
            *uri = mItems.itemAt(index).mURI;
            *uri = mItems.itemAt(index).makeURL(mBaseURI.c_str());
        }

        AString codecs;
@@ -459,12 +464,12 @@ bool M3UParser::getTypeURI(size_t index, const char *key, AString *uri) const {
    // don't care about the active URI (or if there is an active one)
    if (uri != NULL) {
        sp<MediaGroup> group = mMediaGroups.valueFor(groupID);
        if (!group->getActiveURI(uri)) {
        if (!group->getActiveURI(uri, mBaseURI.c_str())) {
            return false;
        }

        if ((*uri).empty()) {
            *uri = mItems.itemAt(index).mURI;
            *uri = mItems.itemAt(index).makeURL(mBaseURI.c_str());
        }
    }

@@ -548,6 +553,18 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
    return true;
}

AString M3UParser::Item::makeURL(const char *baseURL) const {
    AString out;
    CHECK(MakeURL(baseURL, mURI.c_str(), &out));
    return out;
}

AString M3UParser::MediaGroup::Media::makeURL(const char *baseURL) const {
    AString out;
    CHECK(MakeURL(baseURL, mURI.c_str(), &out));
    return out;
}

status_t M3UParser::parse(const void *_data, size_t size) {
    int32_t lineNo = 0;

@@ -678,7 +695,7 @@ status_t M3UParser::parse(const void *_data, size_t size) {
            mItems.push();
            Item *item = &mItems.editItemAt(mItems.size() - 1);

            CHECK(MakeURL(mBaseURI.c_str(), line.c_str(), &item->mURI));
            item->mURI = line;

            item->mMeta = itemMeta;

@@ -1190,9 +1207,7 @@ status_t M3UParser::parseMedia(const AString &line) {

            AString tmp(val, 1, val.size() - 2);

            if (!MakeURL(mBaseURI.c_str(), tmp.c_str(), &groupURI)) {
                ALOGI("Failed to make absolute URI from '%s'.", tmp.c_str());
            }
            groupURI = tmp;

            haveGroupURI = true;
        }
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ private:
    struct Item {
        AString mURI;
        sp<AMessage> mMeta;
        AString makeURL(const char *baseURL) const;
    };

    status_t mInitCheck;
+2 −1
Original line number Diff line number Diff line
@@ -1085,7 +1085,8 @@ status_t OMXNodeInstance::useBuffer(
        }

        case OMXBuffer::kBufferTypeANWBuffer: {
            if (mPortMode[portIndex] != IOMX::kPortModePresetANWBuffer) {
            if (mPortMode[portIndex] != IOMX::kPortModePresetANWBuffer
                    && mPortMode[portIndex] != IOMX::kPortModeDynamicANWBuffer) {
                break;
            }
            return useGraphicBuffer_l(portIndex, omxBuffer.mGraphicBuffer, buffer);