From a6925e6149faf4a936a5b557a769d117454413d8 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 1 Jun 2011 09:12:59 -0700 Subject: Parse RTP-Info even for live streams. Change-Id: Ib2c39ce8d5366f5ea350e71b7a54f5f7c2b510b9 --- media/libstagefright/rtsp/ASessionDescription.cpp | 3 +++ media/libstagefright/rtsp/MyHandler.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'media') diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp index f03f7a2..fd0505e 100644 --- a/media/libstagefright/rtsp/ASessionDescription.cpp +++ b/media/libstagefright/rtsp/ASessionDescription.cpp @@ -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. } diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index d15d9c5..f89f8e2 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -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 getPacketSource(size_t index) { -- cgit v1.1