diff options
author | Andreas Huber <andih@google.com> | 2011-03-30 15:16:36 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-30 15:16:36 -0700 |
commit | b676b73e391b10a4ec5fbd6a1a02054fb3d8aa4b (patch) | |
tree | d0db6fcd9ead234b505761d5254d50be152cc017 /media | |
parent | 91c482b2351db1221308fe90800b8ef8bddbed90 (diff) | |
parent | 45ad57aab33428575d7cde917e9477aac26beb71 (diff) | |
download | frameworks_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
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/NuHTTPDataSource.cpp | 9 |
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; |