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

Commit ab4ff31a authored by Chong Zhang's avatar Chong Zhang Committed by Android Git Automerger
Browse files

am 5bbffc05: Merge "do string compare with mime immediately after we get the value" into lmp-dev

* commit '5bbffc05':
  do string compare with mime immediately after we get the value
parents 042eac90 5bbffc05
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -141,13 +141,17 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
    int32_t totalBitrate = 0;

    for (size_t i = 0; i < extractor->countTracks(); ++i) {
        sp<MediaSource> track = extractor->getTrack(i);

        sp<MetaData> meta = extractor->getTrackMetaData(i);

        const char *mime;
        CHECK(meta->findCString(kKeyMIMEType, &mime));

        sp<MediaSource> track = extractor->getTrack(i);

        // Do the string compare immediately with "mime",
        // we can't assume "mime" would stay valid after another
        // extractor operation, some extractors might modify meta
        // during getTrack() and make it invalid.
        if (!strncasecmp(mime, "audio/", 6)) {
            if (mAudioTrack.mSource == NULL) {
                mAudioTrack.mIndex = i;