summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.cpp
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2014-03-19 02:19:41 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-19 02:19:41 +0000
commit28c3e94a9b02bd5d5ed4b5fe96dff74700f88677 (patch)
tree151c3356429f490d2b0ff7e204e1ab5c4ba9b413 /media/libstagefright/httplive/LiveSession.cpp
parenta933aa34f95ca54a765a2a3f2ef245b7054aef16 (diff)
parent43ca783effd99bba0e6e2dd6fe177a8888578ef8 (diff)
downloadframeworks_av-28c3e94a9b02bd5d5ed4b5fe96dff74700f88677.zip
frameworks_av-28c3e94a9b02bd5d5ed4b5fe96dff74700f88677.tar.gz
frameworks_av-28c3e94a9b02bd5d5ed4b5fe96dff74700f88677.tar.bz2
am 43ca783e: httplive: block-by-block fetch, decrypt, and parse ts files.
* commit '43ca783effd99bba0e6e2dd6fe177a8888578ef8': httplive: block-by-block fetch, decrypt, and parse ts files.
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.cpp')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 90ee3b0..61c54c1 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -626,7 +626,7 @@ sp<PlaylistFetcher> LiveSession::addFetcher(const char *uri) {
* - block_size == 0 means entire range
*
*/
-status_t LiveSession::fetchFile(
+ssize_t LiveSession::fetchFile(
const char *url, sp<ABuffer> *out,
int64_t range_offset, int64_t range_length,
uint32_t block_size, /* download block size */
@@ -677,6 +677,7 @@ status_t LiveSession::fetchFile(
buffer->setRange(0, 0);
}
+ ssize_t bytesRead = 0;
// adjust range_length if only reading partial block
if (block_size > 0 && (range_length == -1 || buffer->size() + block_size < range_length)) {
range_length = buffer->size() + block_size;
@@ -724,6 +725,7 @@ status_t LiveSession::fetchFile(
}
buffer->setRange(0, buffer->size() + (size_t)n);
+ bytesRead += n;
}
*out = buffer;
@@ -734,7 +736,7 @@ status_t LiveSession::fetchFile(
}
}
- return OK;
+ return bytesRead;
}
sp<M3UParser> LiveSession::fetchPlaylist(
@@ -745,9 +747,9 @@ sp<M3UParser> LiveSession::fetchPlaylist(
sp<ABuffer> buffer;
String8 actualUrl;
- status_t err = fetchFile(url, &buffer, 0, -1, 0, NULL, &actualUrl);
+ ssize_t err = fetchFile(url, &buffer, 0, -1, 0, NULL, &actualUrl);
- if (err != OK) {
+ if (err <= 0) {
return NULL;
}