From f0d689934e70d3e5b3784265e890377db04c7c1d Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 28 Jan 2015 21:38:38 -0800 Subject: Revert "HLS: QCom enhancements" This is to restore patch attributions This reverts commit f580806d893c4631f5324ff0af5c2db68a40ef42. Bug: 18821145 Change-Id: Idc49385fffccfde2a3915388fe3fe4e2b740d787 --- media/libstagefright/httplive/LiveSession.cpp | 32 ++------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'media/libstagefright/httplive/LiveSession.cpp') diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index 9daab3b..0b18666 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -49,9 +49,6 @@ namespace android { -// Number of recently-read bytes to use for bandwidth estimation -const size_t LiveSession::kBandwidthHistoryBytes = 200 * 1024; - LiveSession::LiveSession( const sp ¬ify, uint32_t flags, const sp &httpService) @@ -87,13 +84,6 @@ LiveSession::LiveSession( mPacketSources2.add(indexToType(i), new AnotherPacketSource(NULL /* meta */)); mBuffering[i] = false; } - - size_t numHistoryItems = kBandwidthHistoryBytes / - PlaylistFetcher::kDownloadBlockSize + 1; - if (numHistoryItems < 5) { - numHistoryItems = 5; - } - mHTTPDataSource->setBandwidthHistorySize(numHistoryItems); } LiveSession::~LiveSession() { @@ -155,24 +145,10 @@ status_t LiveSession::dequeueAccessUnit( } } - int32_t targetDuration = 0; - sp meta = packetSource->getLatestEnqueuedMeta(); - if (meta != NULL) { - meta->findInt32("targetDuration", &targetDuration); - } - - int64_t targetDurationUs = targetDuration * 1000000ll; - if (targetDurationUs == 0 || - targetDurationUs > PlaylistFetcher::kMinBufferedDurationUs) { - // Fetchers limit buffering to - // min(3 * targetDuration, kMinBufferedDurationUs) - targetDurationUs = PlaylistFetcher::kMinBufferedDurationUs; - } - if (mBuffering[idx]) { if (mSwitchInProgress || packetSource->isFinished(0) - || packetSource->getEstimatedDurationUs() > targetDurationUs) { + || packetSource->getEstimatedDurationUs() > 10000000ll) { mBuffering[idx] = false; } } @@ -883,11 +859,7 @@ ssize_t LiveSession::fetchFile( // Only resize when we don't know the size. size_t bufferRemaining = buffer->capacity() - buffer->size(); if (bufferRemaining == 0 && getSizeErr != OK) { - size_t bufferIncrement = buffer->size() / 2; - if (bufferIncrement < 32768) { - bufferIncrement = 32768; - } - bufferRemaining = bufferIncrement; + bufferRemaining = 32768; ALOGV("increasing download buffer to %zu bytes", buffer->size() + bufferRemaining); -- cgit v1.1