summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-03-18 02:08:46 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-03-18 02:08:46 +0100
commit185e2110a53feb7720d91b6f8366ad27402f21cc (patch)
treea265317b5846eec34d7c87b494ede81857e6c2d3 /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
parentd4590dda7776ec99e4e879c47b3372a5f4b13dcd (diff)
parent8c2e9d8867ccaba1a617f133b37103e2ac77e871 (diff)
downloadframeworks_av-185e2110a53feb7720d91b6f8366ad27402f21cc.zip
frameworks_av-185e2110a53feb7720d91b6f8366ad27402f21cc.tar.gz
frameworks_av-185e2110a53feb7720d91b6f8366ad27402f21cc.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_frameworks_av into replicant-6.0
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index c505096..a18e1da 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -73,6 +73,7 @@ NuPlayer::Decoder::Decoder(
mIsSecure(false),
mFormatChangePending(false),
mTimeChangePending(false),
+ mVideoFormatChangeDoFlushOnly(false),
mResumePending(false),
mComponentName("decoder") {
mCodecLooper = new ALooper;
@@ -243,6 +244,7 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) {
mFormatChangePending = false;
mTimeChangePending = false;
+ mVideoFormatChangeDoFlushOnly = false;
++mBufferGeneration;
@@ -759,9 +761,20 @@ status_t NuPlayer::Decoder::fetchInputData(sp<AMessage> &reply) {
mTimeChangePending = true;
err = ERROR_END_OF_STREAM;
} else if (seamlessFormatChange) {
- // reuse existing decoder and don't flush
- rememberCodecSpecificData(newFormat);
- continue;
+ if (!mIsAudio &&
+ newFormat != NULL &&
+ newFormat->contains("prefer-adaptive-playback")) {
+ ALOGV("in smooth streaming mode, "
+ "do video flush in video seamless format change");
+ mFormatChangePending = true;
+ mVideoFormatChangeDoFlushOnly = true;
+ err = ERROR_END_OF_STREAM;
+ } else {
+ // reuse existing decoder and don't flush
+ rememberCodecSpecificData(newFormat);
+ continue;
+ }
+
} else {
// This stream is unaffected by the discontinuity
return -EWOULDBLOCK;
@@ -989,10 +1002,14 @@ void NuPlayer::Decoder::finishHandleDiscontinuity(bool flushOnTimeChange) {
sp<AMessage> msg = mNotify->dup();
msg->setInt32("what", kWhatInputDiscontinuity);
msg->setInt32("formatChange", mFormatChangePending);
+ if (mVideoFormatChangeDoFlushOnly) {
+ msg->setInt32("video-seamlessChange", mVideoFormatChangeDoFlushOnly);
+ }
msg->post();
mFormatChangePending = false;
mTimeChangePending = false;
+ mVideoFormatChangeDoFlushOnly = false;
}
bool NuPlayer::Decoder::supportsSeamlessAudioFormatChange(