From ef7af7fec702db2fde72b16dedf9064585e6db77 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 18 Aug 2010 10:17:18 -0700 Subject: Better support for rtsp streamed through VLC. Temporarily make the socket blocking to read all of the session description. Change-Id: Ibe71f5941485660510e24d714da3865b9c6f89a2 --- media/libstagefright/rtsp/ASessionDescription.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/rtsp/ASessionDescription.cpp') diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp index ad813cd..4ea7fda 100644 --- a/media/libstagefright/rtsp/ASessionDescription.cpp +++ b/media/libstagefright/rtsp/ASessionDescription.cpp @@ -203,13 +203,18 @@ void ASessionDescription::getFormatType( } } -void ASessionDescription::getDimensions( +bool ASessionDescription::getDimensions( size_t index, unsigned long PT, int32_t *width, int32_t *height) const { + *width = 0; + *height = 0; + char key[20]; sprintf(key, "a=framesize:%lu", PT); AString value; - CHECK(findAttribute(index, key, &value)); + if (!findAttribute(index, key, &value)) { + return false; + } const char *s = value.c_str(); char *end; @@ -221,6 +226,8 @@ void ASessionDescription::getDimensions( *height = strtoul(s, &end, 10); CHECK_GT(end, s); CHECK_EQ(*end, '\0'); + + return true; } bool ASessionDescription::getDurationUs(int64_t *durationUs) const { -- cgit v1.1