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

Commit e5d652ca authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

libstagefright: fix live RTSP streaming on some servers

'npt=0-' is also a valid range to describe an "infinite" session, and
it's used by some popular RTSP servers in mobile environments (Envivio's,
for example). Expecting only 'now-' was causing these sessions to fail (and
thus breaking the "Mobile TV" service).

Also, drop RTP video packets that are out of sequence. Trying to
reorder these was causing a *very* long time in starting the streams.

Change-Id: Id5d5ccfae2e70d9b0a0dfb8f120bf1a9b6d61b5f
parent 6322ecea
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -109,7 +109,10 @@ void ARTPSource::timeUpdate(uint32_t rtpTime, uint64_t ntpTime) {
            uint32_t rtpTime;
            CHECK(meta->findInt32("rtp-time", (int32_t *)&rtpTime));

            if (RTP2NTP(rtpTime) <= ntpTime)
                meta->setInt64("ntp-time", RTP2NTP(rtpTime));
            else
                meta->setInt64("ntp-time", ntpTime);
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -249,6 +249,10 @@ bool ASessionDescription::getDurationUs(int64_t *durationUs) const {
        return false;
    }

    if (value == "npt=0-") {
        return false;
    }

    if (strncmp(value.c_str(), "npt=", 4)) {
        return false;
    }
+1 −1
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ struct MyHandler : public AHandler {
        CHECK(GetAttribute(range.c_str(), "npt", &val));
        float npt1, npt2;

        if (val == "now-") {
        if (val == "now-" || val == "0-") {
            // This is a live stream and therefore not seekable.
            return;
        } else {