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

Commit 7b4df6a3 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "NuPlayer: parcel placeholder mime in track info if not provided by source" into mnc-dev

parents d02ac2c7 2e3a425d
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -423,7 +423,19 @@ void NuPlayer::writeTrackInfo(
    CHECK(format->findInt32("type", &trackType));

    AString mime;
    CHECK(format->findString("mime", &mime));
    if (!format->findString("mime", &mime)) {
        // Java MediaPlayer only uses mimetype for subtitle and timedtext tracks.
        // If we can't find the mimetype here it means that we wouldn't be needing
        // the mimetype on the Java end. We still write a placeholder mime to keep the
        // (de)serialization logic simple.
        if (trackType == MEDIA_TRACK_TYPE_AUDIO) {
            mime = "audio/";
        } else if (trackType == MEDIA_TRACK_TYPE_VIDEO) {
            mime = "video/";
        } else {
            TRESPASS();
        }
    }

    AString lang;
    CHECK(format->findString("language", &lang));