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

Commit b5c6afc2 authored by Andreas Huber's avatar Andreas Huber
Browse files

Squashed commit of the following:

commit de99ae4a523ff5ec40b47071f22fdde1a4b2a0bf
Author: Andreas Huber <andih@google.com>
Date:   Thu Dec 2 13:18:40 2010 -0800

    Scan for sync words to find H.264 frame/AAC frame boundaries if PES packets do not start with them.

    Change-Id: If2861982ecb3006fac806105dbfcd1d43c2a4205

commit be23791ff0d037aa7073589cdc8bfc362e1c281d
Author: Andreas Huber <andih@google.com>
Date:   Thu Dec 2 13:12:39 2010 -0800

    Properly expand relative key URLs and strip surrounding quotes in the M3UParser.

    Change-Id: I013a6d83a64f095d090e5c7730298bdac7d03ab4

commit 0f1d8f65effe0cc42a265dd91d8b91dce6534325
Author: Andreas Huber <andih@google.com>
Date:   Thu Dec 2 13:11:27 2010 -0800

    Ugly hack that assumes that any http url containing "m3u8" refers to an httplive stream.

    Change-Id: I05d7bbc5dab0f9822558122b5b9dc2a109ed8518

commit 255f0d5cdb1072ecd66b47ee614bf574f1388e5a
Author: Andreas Huber <andih@google.com>
Date:   Thu Dec 2 13:10:56 2010 -0800

    Add one more mimetype "application/x-mpegurl" to identify httplive playlists.

    Change-Id: I63fd3b8c2539c9ee23c077df533157af78b10863

Change-Id: I135687383009dbe32d690c9ba8dea60159adc616
parent 97c40a9d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@ public class MediaFile {
        addFileType("WBMP", FILE_TYPE_WBMP, "image/vnd.wap.wbmp");
 
        addFileType("M3U", FILE_TYPE_M3U, "audio/x-mpegurl", MtpConstants.FORMAT_M3U_PLAYLIST);
        addFileType("M3U", FILE_TYPE_M3U, "application/x-mpegurl", MtpConstants.FORMAT_M3U_PLAYLIST);
        addFileType("PLS", FILE_TYPE_PLS, "audio/x-scpls", MtpConstants.FORMAT_PLS_PLAYLIST);
        addFileType("WPL", FILE_TYPE_WPL, "application/vnd.ms-wpl", MtpConstants.FORMAT_WPL_PLAYLIST);
        addFileType("M3U8", FILE_TYPE_HTTPLIVE, "application/vnd.apple.mpegurl");
+2 −1
Original line number Diff line number Diff line
@@ -426,7 +426,8 @@ status_t AwesomePlayer::setDataSource_l(
        // Hack to support http live.

        size_t len = strlen(uri);
        if (!strcasecmp(&uri[len - 5], ".m3u8")) {
        if (!strcasecmp(&uri[len - 5], ".m3u8")
                || strstr(&uri[7], "m3u8") != NULL) {
            mUri = "httplive://";
            mUri.append(&uri[7]);
        }
+0 −8
Original line number Diff line number Diff line
@@ -359,14 +359,6 @@ bool LiveSource::setupCipher() {
            return false;
        }

        if (keyURI.size() >= 2
                && keyURI.c_str()[0] == '"'
                && keyURI.c_str()[keyURI.size() - 1] == '"') {
            // Remove surrounding quotes.
            AString tmp(keyURI, 1, keyURI.size() - 2);
            keyURI = tmp;
        }

        ssize_t index = mAESKeyForURI.indexOfKey(keyURI);

        sp<ABuffer> key;
+20 −2
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ status_t M3UParser::parse(const void *_data, size_t size) {
                if (mIsVariantPlaylist) {
                    return ERROR_MALFORMED;
                }
                err = parseCipherInfo(line, &itemMeta);
                err = parseCipherInfo(line, &itemMeta, mBaseURI);
            } else if (line.startsWith("#EXT-X-ENDLIST")) {
                mIsComplete = true;
            } else if (line.startsWith("#EXTINF")) {
@@ -298,7 +298,7 @@ status_t M3UParser::parseStreamInf(

// static
status_t M3UParser::parseCipherInfo(
        const AString &line, sp<AMessage> *meta) {
        const AString &line, sp<AMessage> *meta, const AString &baseURI) {
    ssize_t colonPos = line.find(":");

    if (colonPos < 0) {
@@ -338,6 +338,24 @@ status_t M3UParser::parseCipherInfo(
                *meta = new AMessage;
            }

            if (key == "uri") {
                if (val.size() >= 2
                        && val.c_str()[0] == '"'
                        && val.c_str()[val.size() - 1] == '"') {
                    // Remove surrounding quotes.
                    AString tmp(val, 1, val.size() - 2);
                    val = tmp;
                }

                AString absURI;
                if (MakeURL(baseURI.c_str(), val.c_str(), &absURI)) {
                    val = absURI;
                } else {
                    LOGE("failed to make absolute url for '%s'.",
                         val.c_str());
                }
            }

            key.insert(AString("cipher-"), 0);

            (*meta)->setString(key.c_str(), val.c_str(), val.size());
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ private:
            const AString &line, sp<AMessage> *meta);

    static status_t parseCipherInfo(
            const AString &line, sp<AMessage> *meta);
            const AString &line, sp<AMessage> *meta, const AString &baseURI);

    static status_t ParseInt32(const char *s, int32_t *x);

Loading