diff options
author | Apurupa Pattapu <apurupa@codeaurora.org> | 2014-10-14 15:05:50 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-01-28 21:52:09 -0800 |
commit | 79971c747e62cad50359286f18dee0c4de5829da (patch) | |
tree | d0c36872da5d2cfff2a8e198ce2dbc99ec85acbe /media/libstagefright/httplive | |
parent | 9dee2e592e89e90097cbb3b5065cffa768917b56 (diff) | |
download | frameworks_av-79971c747e62cad50359286f18dee0c4de5829da.zip frameworks_av-79971c747e62cad50359286f18dee0c4de5829da.tar.gz frameworks_av-79971c747e62cad50359286f18dee0c4de5829da.tar.bz2 |
httplive: Dont resume if we have almost fetched till stop time
- Use the last enqueued instead of last dequeued time in
ResumeUntil.
- Set duration in access unit meta as timestamp difference
between the last two queued access units.
Bug: 18821145
Change-Id: If53ddee1d87775905a6d4f11a6219fe66f498450
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 440465c..07c86e5 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -50,7 +50,7 @@ namespace android { const int64_t PlaylistFetcher::kMinBufferedDurationUs = 10000000ll; const int64_t PlaylistFetcher::kMaxMonitorDelayUs = 3000000ll; const int32_t PlaylistFetcher::kDownloadBlockSize = 2048; -const int32_t PlaylistFetcher::kNumSkipFrames = 10; +const int32_t PlaylistFetcher::kNumSkipFrames = 5; PlaylistFetcher::PlaylistFetcher( const sp<AMessage> ¬ify, @@ -561,7 +561,7 @@ status_t PlaylistFetcher::onResumeUntil(const sp<AMessage> &msg) { // Don't resume if we would stop within a resume threshold. int32_t discontinuitySeq; int64_t latestTimeUs = 0, stopTimeUs = 0; - sp<AMessage> latestMeta = packetSource->getLatestDequeuedMeta(); + sp<AMessage> latestMeta = packetSource->getLatestEnqueuedMeta(); if (latestMeta != NULL && latestMeta->findInt32("discontinuitySeq", &discontinuitySeq) && discontinuitySeq == mDiscontinuitySeq @@ -1678,7 +1678,7 @@ void PlaylistFetcher::updateDuration() { int64_t PlaylistFetcher::resumeThreshold(const sp<AMessage> &msg) { int64_t durationUs, threshold; - if (msg->findInt64("durationUs", &durationUs)) { + if (msg->findInt64("durationUs", &durationUs) && durationUs > 0) { return kNumSkipFrames * durationUs; } |