diff options
author | Andreas Huber <andih@google.com> | 2010-06-10 11:13:55 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-06-10 11:26:24 -0700 |
commit | 1370cbe385c4295471910aacbef51a8a65ce533d (patch) | |
tree | de1119f23976ae662e9ff4d058d096b601345ad7 /media/libstagefright/httplive | |
parent | 98c7c319907f4ed3915461ca62b1027590d351e5 (diff) | |
download | frameworks_av-1370cbe385c4295471910aacbef51a8a65ce533d.zip frameworks_av-1370cbe385c4295471910aacbef51a8a65ce533d.tar.gz frameworks_av-1370cbe385c4295471910aacbef51a8a65ce533d.tar.bz2 |
Switch LiveSource to use the new http data source instead of the old one.
Change-Id: I9623c480628c495dbfbe02bdc6372724a107e2e8
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r-- | media/libstagefright/httplive/LiveSource.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/media/libstagefright/httplive/LiveSource.cpp b/media/libstagefright/httplive/LiveSource.cpp index 9e3aa7b..001afc4 100644 --- a/media/libstagefright/httplive/LiveSource.cpp +++ b/media/libstagefright/httplive/LiveSource.cpp @@ -18,12 +18,10 @@ #include <utils/Log.h> #include "include/LiveSource.h" - -#include "include/HTTPStream.h" #include "include/M3UParser.h" +#include "include/NuHTTPDataSource.h" #include <media/stagefright/foundation/ABuffer.h> -#include <media/stagefright/HTTPDataSource.h> #include <media/stagefright/MediaDebug.h> namespace android { @@ -33,6 +31,7 @@ LiveSource::LiveSource(const char *url) mInitCheck(NO_INIT), mPlaylistIndex(0), mLastFetchTimeUs(-1), + mSource(new NuHTTPDataSource), mSourceSize(0), mOffsetBias(0) { if (switchToNext()) { @@ -115,8 +114,7 @@ bool LiveSource::switchToNext() { CHECK(mPlaylist->itemAt(mPlaylistIndex, &uri)); LOGI("switching to %s", uri.c_str()); - mSource = new HTTPDataSource(uri.c_str()); - if (mSource->connect() != OK + if (mSource->connect(uri.c_str()) != OK || mSource->getSize(&mSourceSize) != OK) { return false; } @@ -156,8 +154,7 @@ ssize_t LiveSource::readAt(off_t offset, void *data, size_t size) { status_t LiveSource::fetchM3U(const char *url, sp<ABuffer> *out) { *out = NULL; - mSource = new HTTPDataSource(url); - status_t err = mSource->connect(); + status_t err = mSource->connect(url); if (err != OK) { return err; |