summaryrefslogtreecommitdiffstats
path: root/media
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
commitcbd2ba4e5398e2c2ae71a1fce6bd6d6b1e395fd6 (patch)
tree4e8dd8f25a167893ad30efb856e4270186f7da00 /media
parent89c120e7adbe09c6283591789594c5e591aa5032 (diff)
parent9dc0193472834c49e6bdc864fbeb145828f1d8aa (diff)
downloadframeworks_av-cbd2ba4e5398e2c2ae71a1fce6bd6d6b1e395fd6.zip
frameworks_av-cbd2ba4e5398e2c2ae71a1fce6bd6d6b1e395fd6.tar.gz
frameworks_av-cbd2ba4e5398e2c2ae71a1fce6bd6d6b1e395fd6.tar.bz2
Merge "When http streaming and Content-Length is unknown, make sure to return all" into honeycomb-mr1
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;