summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-03-30 15:16:36 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-30 15:16:36 -0700
commitb676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b (patch)
treed0db6fcd9ead234b505761d5254d50be152cc017
parent91c482b2351db1221308fe90800b8ef8bddbed90 (diff)
parent45ad57aab33428575d7cde917e9477aac26beb71 (diff)
downloadframeworks_base-b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b.zip
frameworks_base-b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b.tar.gz
frameworks_base-b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b.tar.bz2
Merge "When http streaming and Content-Length is unknown, make sure to return all" into honeycomb-mr1
-rw-r--r--media/libstagefright/NuHTTPDataSource.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libstagefright/NuHTTPDataSource.cpp b/media/libstagefright/NuHTTPDataSource.cpp
index b24343f..bee0d5e 100644
--- a/media/libstagefright/NuHTTPDataSource.cpp
+++ b/media/libstagefright/NuHTTPDataSource.cpp
@@ -410,7 +410,14 @@ ssize_t NuHTTPDataSource::readAt(off64_t offset, void *data, size_t size) {
internalRead((uint8_t *)data + numBytesRead, size - numBytesRead);
if (n < 0) {
- return n;
+ if (numBytesRead == 0 || mContentLengthValid) {
+ return n;
+ }
+
+ // If there was an error we want to at least return the data
+ // we've already successfully read. The next call to read will
+ // then return the error.
+ n = 0;
}
int64_t delayUs = ALooper::GetNowUs() - startTimeUs;