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

Commit c9b879f0 authored by Robert Shih's avatar Robert Shih Committed by syphyr
Browse files

M3UParser: handle missing EXT-X-MEDIA URIs

Bug: 111381540
Test: http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
Change-Id: I57f6cea59ce4c25267385289ab805eefe74b04ac
(cherry picked from commit b8c3a74d)
parent 0186614a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -233,7 +233,11 @@ bool M3UParser::MediaGroup::getActiveURI(AString *uri, const char *baseURL) cons
        if (mSelectedIndex >= 0 && i == (size_t)mSelectedIndex) {
            const Media &item = mMediaItems.itemAt(i);

            if (item.mURI.empty()) {
                *uri = "";
            } else {
                *uri = item.makeURL(baseURL);
            }
            return true;
        }
    }
@@ -464,7 +468,7 @@ bool M3UParser::getTypeURI(size_t index, const char *key, AString *uri) const {
        }

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