summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-04-01 14:28:31 -0700
committerAndreas Huber <andih@google.com>2013-04-01 14:28:31 -0700
commit7069bdf24a9e3393479368e83f9009817869c33c (patch)
tree2e4698654f2d6d6d9d50fc527ec00f7480c84296 /media/libmediaplayerservice/nuplayer
parent2f711486c2b35610fb8e114968263e6660cdb683 (diff)
downloadframeworks_av-7069bdf24a9e3393479368e83f9009817869c33c.zip
frameworks_av-7069bdf24a9e3393479368e83f9009817869c33c.tar.gz
frameworks_av-7069bdf24a9e3393479368e83f9009817869c33c.tar.bz2
Fix seek in response to OnPrepared() for HLS content
Change-Id: I0e52352845398a4db074e939487f6f6de94bd523 related-to-bug: 8225122
Diffstat (limited to 'media/libmediaplayerservice/nuplayer')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 5387e1a..46d0a5a 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -161,7 +161,8 @@ void NuPlayer::setDataSourceAsync(const sp<IStreamSource> &source) {
static bool IsHTTPLiveURL(const char *url) {
if (!strncasecmp("http://", url, 7)
- || !strncasecmp("https://", url, 8)) {
+ || !strncasecmp("https://", url, 8)
+ || !strncasecmp("file://", url, 7)) {
size_t len = strlen(url);
if (len >= 5 && !strcasecmp(".m3u8", &url[len - 5])) {
return true;
@@ -833,14 +834,6 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<Decoder> *decoder) {
(*decoder)->configure(format);
- int64_t durationUs;
- if (mDriver != NULL && mSource->getDuration(&durationUs) == OK) {
- sp<NuPlayerDriver> driver = mDriver.promote();
- if (driver != NULL) {
- driver->notifyDuration(durationUs);
- }
- }
-
return OK;
}
@@ -1271,6 +1264,14 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
if (driver != NULL) {
driver->notifyPrepareCompleted(err);
}
+
+ int64_t durationUs;
+ if (mDriver != NULL && mSource->getDuration(&durationUs) == OK) {
+ sp<NuPlayerDriver> driver = mDriver.promote();
+ if (driver != NULL) {
+ driver->notifyDuration(durationUs);
+ }
+ }
break;
}