summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ASessionDescription.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-08-21 09:40:57 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-21 09:40:57 -0700
commit91d113e8daa9d71c4ea8afd595a3921e03787cbf (patch)
treefea830e50f39e59aaef2e5935bbb86a708d027d8 /media/libstagefright/rtsp/ASessionDescription.cpp
parent69e0b8c5556df1d4db1a730db1c13409a96749c7 (diff)
parentb9b08ff55456fe845cb4c64500e9cb53682e202f (diff)
downloadframeworks_av-91d113e8daa9d71c4ea8afd595a3921e03787cbf.zip
frameworks_av-91d113e8daa9d71c4ea8afd595a3921e03787cbf.tar.gz
frameworks_av-91d113e8daa9d71c4ea8afd595a3921e03787cbf.tar.bz2
am 6bcffcd2: am 8c192fe9: Merge "Better support for rtsp streamed through VLC. Temporarily make the socket blocking to read all of the session description." into gingerbread
Merge commit '6bcffcd2dc410db780c152c70a01b22da6ca58be' * commit '6bcffcd2dc410db780c152c70a01b22da6ca58be': Better support for rtsp streamed through VLC. Temporarily make the socket blocking to read all of the session description.
Diffstat (limited to 'media/libstagefright/rtsp/ASessionDescription.cpp')
-rw-r--r--media/libstagefright/rtsp/ASessionDescription.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp
index 8187e0c..4a8cce8 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 {