summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
diff options
context:
space:
mode:
authorShalaj Jain <shalajj@codeaurora.org>2015-10-13 17:56:23 -0700
committerShivaprasad Hongal <shongal@codeaurora.org>2015-10-26 20:36:36 -0700
commita729f437f5f46efbd366721d7d4f398186ce77cd (patch)
tree41908c6e819bc23a0ae57de0590552b077d6f3a0 /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
parentd4c3afbb613f7201ece31ad2230ec22289422680 (diff)
downloadframeworks_av-a729f437f5f46efbd366721d7d4f398186ce77cd.zip
frameworks_av-a729f437f5f46efbd366721d7d4f398186ce77cd.tar.gz
frameworks_av-a729f437f5f46efbd366721d7d4f398186ce77cd.tar.bz2
nuplayer: Drop frames with DATACORRUPT flag
Drop frames in NuplayerDecoder if the corresponding OMX_BUFFERFLAG_DATACORRUPT is set from OMX. Add a util function to easily switch off this feature. Do not declare MediaSource explicitly. Change-Id: I97bd238d52d660e1ab61eac222cdff28334cc5cc
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index f83eaf6..997920b 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -590,6 +590,14 @@ bool NuPlayer::Decoder::handleAnOutputBuffer(
reply->setSize("buffer-ix", index);
reply->setInt32("generation", mBufferGeneration);
+ if ((flags & MediaCodec::BUFFER_FLAG_DATACORRUPT) &&
+ AVNuUtils::get()->dropCorruptFrame()) {
+ ALOGV("[%s] dropping corrupt buffer at time %lld as requested.",
+ mComponentName.c_str(), (long long)timeUs);
+ reply->post();
+ return true;
+ }
+
if (eos) {
ALOGI("[%s] saw output EOS", mIsAudio ? "audio" : "video");