summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-03-30 15:19:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-30 15:19:46 -0700
commit06ac039962c7f15938afc4bbb74c2f14de4dc505 (patch)
tree1c3d7f9f430256426cb529d292202b34e44e16d5 /media
parentacf48255aa3706489839948f153615e5c5cf38cb (diff)
parentb676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b (diff)
downloadframeworks_base-06ac039962c7f15938afc4bbb74c2f14de4dc505.zip
frameworks_base-06ac039962c7f15938afc4bbb74c2f14de4dc505.tar.gz
frameworks_base-06ac039962c7f15938afc4bbb74c2f14de4dc505.tar.bz2
am b676b73e: Merge "When http streaming and Content-Length is unknown, make sure to return all" into honeycomb-mr1
* commit 'b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b': When http streaming and Content-Length is unknown, make sure to return all
Diffstat (limited to 'media')
-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;