diff options
author | Andreas Huber <andih@google.com> | 2011-03-30 16:40:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-30 16:40:43 -0700 |
commit | db513feea83a4f76d8a6b492ff33d3d53247ac5e (patch) | |
tree | f35bd7e8745db36fa98535b11f3d420c71042508 | |
parent | 5c43188653b82a8b40bd25ded8b3b8c48d67e132 (diff) | |
parent | ba7d7874192e9670e7a51e7e334732c96f27ab5d (diff) | |
download | frameworks_av-db513feea83a4f76d8a6b492ff33d3d53247ac5e.zip frameworks_av-db513feea83a4f76d8a6b492ff33d3d53247ac5e.tar.gz frameworks_av-db513feea83a4f76d8a6b492ff33d3d53247ac5e.tar.bz2 |
am 399792b8: am 06ac0399: am b676b73e: Merge "When http streaming and Content-Length is unknown, make sure to return all" into honeycomb-mr1
* commit '399792b83174a835840a4f47adcd34aed4e0b9ba':
When http streaming and Content-Length is unknown, make sure to return all
-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 5c43a5b..821ba9b 100644 --- a/media/libstagefright/NuHTTPDataSource.cpp +++ b/media/libstagefright/NuHTTPDataSource.cpp @@ -420,7 +420,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; |