Loading media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ bool NuPlayer::HTTPLiveSource::feedMoreTSData() { sp<LiveDataSource> source = static_cast<LiveDataSource *>(mLiveSession->getDataSource().get()); for (int32_t i = 0; i < 10; ++i) { for (int32_t i = 0; i < 50; ++i) { char buffer[188]; ssize_t n = source->readAtNonBlocking(mOffset, buffer, sizeof(buffer)); Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −10 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { int64_t seekTimeUs; CHECK(msg->findInt64("seekTimeUs", &seekTimeUs)); LOGI("kWhatSeek seekTimeUs=%lld us (%.2f secs)", LOGV("kWhatSeek seekTimeUs=%lld us (%.2f secs)", seekTimeUs, seekTimeUs / 1E6); mSource->seekTo(seekTimeUs); Loading Loading @@ -428,17 +428,11 @@ void NuPlayer::finishFlushIfPossible() { mRenderer->signalTimeDiscontinuity(); bool scanSourcesAgain = false; if (mFlushingAudio == SHUT_DOWN) { scanSourcesAgain = true; } else if (mAudioDecoder != NULL) { if (mAudioDecoder != NULL) { mAudioDecoder->signalResume(); } if (mFlushingVideo == SHUT_DOWN) { scanSourcesAgain = true; } else if (mVideoDecoder != NULL) { if (mVideoDecoder != NULL) { mVideoDecoder->signalResume(); } Loading @@ -453,7 +447,7 @@ void NuPlayer::finishFlushIfPossible() { } else if (mResetPostponed) { (new AMessage(kWhatReset, id()))->post(); mResetPostponed = false; } else if (scanSourcesAgain) { } else if (mAudioDecoder == NULL || mVideoDecoder == NULL) { postScanSources(); } } Loading media/libstagefright/httplive/LiveSession.cpp +17 −3 Original line number Diff line number Diff line Loading @@ -385,6 +385,7 @@ void LiveSession::onDownloadNext() { } bool explicitDiscontinuity = false; bool bandwidthChanged = false; if (mSeekTimeUs >= 0) { int32_t targetDuration; Loading @@ -404,7 +405,14 @@ void LiveSession::onDownloadNext() { mDataSource->reset(); // reseting the data source will have had the // side effect of discarding any previously queued // bandwidth change discontinuity. // Therefore we'll need to treat these explicit // discontinuities as involving a bandwidth change // even if they aren't directly. explicitDiscontinuity = true; bandwidthChanged = true; } } } Loading Loading @@ -484,9 +492,15 @@ void LiveSession::onDownloadNext() { return; } bool bandwidthChanged = mPrevBandwidthIndex >= 0 && (size_t)mPrevBandwidthIndex != bandwidthIndex; if ((size_t)mPrevBandwidthIndex != bandwidthIndex) { bandwidthChanged = true; } if (mPrevBandwidthIndex < 0) { // Don't signal a bandwidth change at the very beginning of // playback. bandwidthChanged = false; } if (explicitDiscontinuity || bandwidthChanged) { // Signal discontinuity. Loading media/libstagefright/mpeg2ts/ATSParser.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -351,7 +351,6 @@ void ATSParser::Stream::signalDiscontinuity(DiscontinuityType type) { mQueue.clear(!isASeek); if (mSource != NULL) { mSource->clear(); mSource->queueDiscontinuity(type); } break; Loading media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +13 −6 Original line number Diff line number Diff line Loading @@ -142,15 +142,22 @@ void AnotherPacketSource::queueDiscontinuity( Mutex::Autolock autoLock(mLock); mBuffers.push_back(buffer); mCondition.signal(); } #if 0 if (type == ATSParser::DISCONTINUITY_SEEK || type == ATSParser::DISCONTINUITY_FORMATCHANGE) { // XXX Fix this: This will also clear any pending discontinuities, // If there's a pending DISCONTINUITY_FORMATCHANGE and the new // discontinuity is "just" a DISCONTINUITY_SEEK, this will effectively // downgrade the type of discontinuity received by the client. void AnotherPacketSource::clear() { Mutex::Autolock autoLock(mLock); mBuffers.clear(); mEOSResult = OK; } #endif mBuffers.push_back(buffer); mCondition.signal(); } void AnotherPacketSource::signalEOS(status_t result) { CHECK(result != OK); Loading Loading
media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ bool NuPlayer::HTTPLiveSource::feedMoreTSData() { sp<LiveDataSource> source = static_cast<LiveDataSource *>(mLiveSession->getDataSource().get()); for (int32_t i = 0; i < 10; ++i) { for (int32_t i = 0; i < 50; ++i) { char buffer[188]; ssize_t n = source->readAtNonBlocking(mOffset, buffer, sizeof(buffer)); Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −10 Original line number Diff line number Diff line Loading @@ -394,7 +394,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { int64_t seekTimeUs; CHECK(msg->findInt64("seekTimeUs", &seekTimeUs)); LOGI("kWhatSeek seekTimeUs=%lld us (%.2f secs)", LOGV("kWhatSeek seekTimeUs=%lld us (%.2f secs)", seekTimeUs, seekTimeUs / 1E6); mSource->seekTo(seekTimeUs); Loading Loading @@ -428,17 +428,11 @@ void NuPlayer::finishFlushIfPossible() { mRenderer->signalTimeDiscontinuity(); bool scanSourcesAgain = false; if (mFlushingAudio == SHUT_DOWN) { scanSourcesAgain = true; } else if (mAudioDecoder != NULL) { if (mAudioDecoder != NULL) { mAudioDecoder->signalResume(); } if (mFlushingVideo == SHUT_DOWN) { scanSourcesAgain = true; } else if (mVideoDecoder != NULL) { if (mVideoDecoder != NULL) { mVideoDecoder->signalResume(); } Loading @@ -453,7 +447,7 @@ void NuPlayer::finishFlushIfPossible() { } else if (mResetPostponed) { (new AMessage(kWhatReset, id()))->post(); mResetPostponed = false; } else if (scanSourcesAgain) { } else if (mAudioDecoder == NULL || mVideoDecoder == NULL) { postScanSources(); } } Loading
media/libstagefright/httplive/LiveSession.cpp +17 −3 Original line number Diff line number Diff line Loading @@ -385,6 +385,7 @@ void LiveSession::onDownloadNext() { } bool explicitDiscontinuity = false; bool bandwidthChanged = false; if (mSeekTimeUs >= 0) { int32_t targetDuration; Loading @@ -404,7 +405,14 @@ void LiveSession::onDownloadNext() { mDataSource->reset(); // reseting the data source will have had the // side effect of discarding any previously queued // bandwidth change discontinuity. // Therefore we'll need to treat these explicit // discontinuities as involving a bandwidth change // even if they aren't directly. explicitDiscontinuity = true; bandwidthChanged = true; } } } Loading Loading @@ -484,9 +492,15 @@ void LiveSession::onDownloadNext() { return; } bool bandwidthChanged = mPrevBandwidthIndex >= 0 && (size_t)mPrevBandwidthIndex != bandwidthIndex; if ((size_t)mPrevBandwidthIndex != bandwidthIndex) { bandwidthChanged = true; } if (mPrevBandwidthIndex < 0) { // Don't signal a bandwidth change at the very beginning of // playback. bandwidthChanged = false; } if (explicitDiscontinuity || bandwidthChanged) { // Signal discontinuity. Loading
media/libstagefright/mpeg2ts/ATSParser.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -351,7 +351,6 @@ void ATSParser::Stream::signalDiscontinuity(DiscontinuityType type) { mQueue.clear(!isASeek); if (mSource != NULL) { mSource->clear(); mSource->queueDiscontinuity(type); } break; Loading
media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +13 −6 Original line number Diff line number Diff line Loading @@ -142,15 +142,22 @@ void AnotherPacketSource::queueDiscontinuity( Mutex::Autolock autoLock(mLock); mBuffers.push_back(buffer); mCondition.signal(); } #if 0 if (type == ATSParser::DISCONTINUITY_SEEK || type == ATSParser::DISCONTINUITY_FORMATCHANGE) { // XXX Fix this: This will also clear any pending discontinuities, // If there's a pending DISCONTINUITY_FORMATCHANGE and the new // discontinuity is "just" a DISCONTINUITY_SEEK, this will effectively // downgrade the type of discontinuity received by the client. void AnotherPacketSource::clear() { Mutex::Autolock autoLock(mLock); mBuffers.clear(); mEOSResult = OK; } #endif mBuffers.push_back(buffer); mCondition.signal(); } void AnotherPacketSource::signalEOS(status_t result) { CHECK(result != OK); Loading