diff options
author | Marco Nelissen <marcone@google.com> | 2014-02-20 17:27:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-20 17:27:17 +0000 |
commit | aa0390b77cf068eda8e7bdf94348625db0c12144 (patch) | |
tree | aa74eecfc384795dc4968bde326ce0fdbf96c5be /media | |
parent | 8dad284a8ac588ef0be92c6a467e525f07c164cd (diff) | |
parent | 4ee5d2b9d0cdaf936bd5fecd670e5f38da63e4ae (diff) | |
download | frameworks_av-aa0390b77cf068eda8e7bdf94348625db0c12144.zip frameworks_av-aa0390b77cf068eda8e7bdf94348625db0c12144.tar.gz frameworks_av-aa0390b77cf068eda8e7bdf94348625db0c12144.tar.bz2 |
am 4ee5d2b9: Merge "LiveSession: Use the actual, possibly redirected url as base in the M3U"
* commit '4ee5d2b9d0cdaf936bd5fecd670e5f38da63e4ae':
LiveSession: Use the actual, possibly redirected url as base in the M3U
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/httplive/LiveSession.cpp | 14 | ||||
-rw-r--r-- | media/libstagefright/httplive/LiveSession.h | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index 233db44..fc1353a 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -514,7 +514,8 @@ sp<PlaylistFetcher> LiveSession::addFetcher(const char *uri) { status_t LiveSession::fetchFile( const char *url, sp<ABuffer> *out, - int64_t range_offset, int64_t range_length) { + int64_t range_offset, int64_t range_length, + String8 *actualUrl) { *out = NULL; sp<DataSource> source; @@ -599,6 +600,12 @@ status_t LiveSession::fetchFile( } *out = buffer; + if (actualUrl != NULL) { + *actualUrl = source->getUri(); + if (actualUrl->isEmpty()) { + *actualUrl = url; + } + } return OK; } @@ -610,7 +617,8 @@ sp<M3UParser> LiveSession::fetchPlaylist( *unchanged = false; sp<ABuffer> buffer; - status_t err = fetchFile(url, &buffer); + String8 actualUrl; + status_t err = fetchFile(url, &buffer, 0, -1, &actualUrl); if (err != OK) { return NULL; @@ -641,7 +649,7 @@ sp<M3UParser> LiveSession::fetchPlaylist( #endif sp<M3UParser> playlist = - new M3UParser(url, buffer->data(), buffer->size()); + new M3UParser(actualUrl.string(), buffer->data(), buffer->size()); if (playlist->initCheck() != OK) { ALOGE("failed to parse .m3u8 playlist"); diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h index 99b480a8..8f6a4ea 100644 --- a/media/libstagefright/httplive/LiveSession.h +++ b/media/libstagefright/httplive/LiveSession.h @@ -147,7 +147,8 @@ private: status_t fetchFile( const char *url, sp<ABuffer> *out, - int64_t range_offset = 0, int64_t range_length = -1); + int64_t range_offset = 0, int64_t range_length = -1, + String8 *actualUrl = NULL); sp<M3UParser> fetchPlaylist( const char *url, uint8_t *curPlaylistHash, bool *unchanged); |