Parse RTP-Info even for live streams.

Change-Id: Ib2c39ce8d5366f5ea350e71b7a54f5f7c2b510b9
This commit is contained in:
Andreas Huber
2011-06-01 09:12:59 -07:00
parent df02afe835
commit d873413ff9
2 changed files with 7 additions and 2 deletions

View File

@@ -301,6 +301,9 @@ void ASessionDescription::ParseFormatDesc(
// static
bool ASessionDescription::parseNTPRange(
const char *s, float *npt1, float *npt2) {
*npt1 = 0.0f;
*npt2 = 0.0f;
if (s[0] == '-') {
return false; // no start time available.
}

View File

@@ -995,10 +995,12 @@ struct MyHandler : public AHandler {
AString val;
CHECK(GetAttribute(range.c_str(), "npt", &val));
bool seekable = true;
float npt1, npt2;
if (!ASessionDescription::parseNTPRange(val.c_str(), &npt1, &npt2)) {
// This is a live stream and therefore not seekable.
return;
seekable = false;
}
i = response->mHeaders.indexOfKey("rtp-info");
@@ -1044,7 +1046,7 @@ struct MyHandler : public AHandler {
++n;
}
mSeekable = true;
mSeekable = seekable;
}
sp<APacketSource> getPacketSource(size_t index) {