diff options
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.cpp')
-rw-r--r-- | media/libstagefright/httplive/LiveSession.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index bd12ddc..d4fd2b3 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; @@ -644,7 +652,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"); |