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

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

Merge "Fix seek in response to OnPrepared() for HLS content" into jb-mr2-dev

parents 0fb6aabf 99759408
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -206,7 +206,8 @@ class NuPlayerFactory : public MediaPlayerFactory::IFactory {
            return 0.0;

        if (!strncasecmp("http://", url, 7)
                || !strncasecmp("https://", url, 8)) {
                || !strncasecmp("https://", url, 8)
                || !strncasecmp("file://", url, 7)) {
            size_t len = strlen(url);
            if (len >= 5 && !strcasecmp(".m3u8", &url[len - 5])) {
                return kOurScore;
+10 −9
Original line number Diff line number Diff line
@@ -161,7 +161,8 @@ void NuPlayer::setDataSourceAsync(const sp<IStreamSource> &source) {

static bool IsHTTPLiveURL(const char *url) {
    if (!strncasecmp("http://", url, 7)
            || !strncasecmp("https://", url, 8)) {
            || !strncasecmp("https://", url, 8)
            || !strncasecmp("file://", url, 7)) {
        size_t len = strlen(url);
        if (len >= 5 && !strcasecmp(".m3u8", &url[len - 5])) {
            return true;
@@ -833,14 +834,6 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<Decoder> *decoder) {

    (*decoder)->configure(format);

    int64_t durationUs;
    if (mDriver != NULL && mSource->getDuration(&durationUs) == OK) {
        sp<NuPlayerDriver> driver = mDriver.promote();
        if (driver != NULL) {
            driver->notifyDuration(durationUs);
        }
    }

    return OK;
}

@@ -1271,6 +1264,14 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
            if (driver != NULL) {
                driver->notifyPrepareCompleted(err);
            }

            int64_t durationUs;
            if (mDriver != NULL && mSource->getDuration(&durationUs) == OK) {
                sp<NuPlayerDriver> driver = mDriver.promote();
                if (driver != NULL) {
                    driver->notifyDuration(durationUs);
                }
            }
            break;
        }

+11 −13
Original line number Diff line number Diff line
@@ -631,7 +631,6 @@ rinse_repeat:
            if (index < mPlaylist->size()) {
                int32_t newSeqNumber = firstSeqNumberInPlaylist + index;

                if (newSeqNumber != mSeqNumber) {
                ALOGI("seeking to seq no %d", newSeqNumber);

                mSeqNumber = newSeqNumber;
@@ -648,7 +647,6 @@ rinse_repeat:
                bandwidthChanged = true;
            }
        }
        }

        mSeekTimeUs = -1;