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

Commit 6461c973 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "More HLS fixes"

parents 1003aeb9 9073725c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -785,7 +785,10 @@ status_t LiveSession::decryptBuffer(
            keySource->setUID(mUID);
        }

        status_t err = keySource->connect(keyURI.c_str());
        status_t err =
            keySource->connect(
                    keyURI.c_str(),
                    mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders);

        if (err == OK) {
            size_t offset = 0;
+26 −9
Original line number Diff line number Diff line
@@ -106,6 +106,22 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
        return true;
    }

    if (url[0] == '/') {
        // URL is an absolute path.

        char *protocolEnd = strstr(baseURL, "//") + 2;
        char *pathStart = strchr(protocolEnd, '/');

        if (pathStart != NULL) {
            out->setTo(baseURL, pathStart - baseURL);
        } else {
            out->setTo(baseURL);
        }

        out->append(url);
    } else {
        // URL is a relative path

        size_t n = strlen(baseURL);
        if (baseURL[n - 1] == '/') {
            out->setTo(baseURL);
@@ -122,6 +138,7 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
            out->append("/");
            out->append(url);
        }
    }

    LOGV("base:'%s', url:'%s' => '%s'", baseURL, url, out->c_str());