merge in oc-r6-release history after reset to oc-release
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 77f0cab..18fd857 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -83,9 +83,6 @@
#include "HTTPBase.h"
#include "RemoteDisplay.h"
-static const int kDumpLockRetries = 50;
-static const int kDumpLockSleepUs = 20000;
-
namespace {
using android::media::Metadata;
using android::status_t;
@@ -395,32 +392,12 @@
snprintf(buffer, 255, " pid(%d), connId(%d), status(%d), looping(%s)\n",
mPid, mConnId, mStatus, mLoop?"true": "false");
result.append(buffer);
-
- sp<MediaPlayerBase> p;
- sp<AudioOutput> audioOutput;
- bool locked = false;
- for (int i = 0; i < kDumpLockRetries; ++i) {
- if (mLock.tryLock() == NO_ERROR) {
- locked = true;
- break;
- }
- usleep(kDumpLockSleepUs);
- }
-
- if (locked) {
- p = mPlayer;
- audioOutput = mAudioOutput;
- mLock.unlock();
- } else {
- result.append(" lock is taken, no dump from player and audio output\n");
- }
write(fd, result.string(), result.size());
-
- if (p != NULL) {
- p->dump(fd, args);
+ if (mPlayer != NULL) {
+ mPlayer->dump(fd, args);
}
- if (audioOutput != 0) {
- audioOutput->dump(fd, args);
+ if (mAudioOutput != 0) {
+ mAudioOutput->dump(fd, args);
}
write(fd, "\n", 1);
return NO_ERROR;
@@ -600,10 +577,7 @@
MediaPlayerService::Client::~Client()
{
ALOGV("Client(%d) destructor pid = %d", mConnId, mPid);
- {
- Mutex::Autolock l(mLock);
- mAudioOutput.clear();
- }
+ mAudioOutput.clear();
wp<Client> client(this);
disconnect();
mService->removeClient(client);
@@ -623,9 +597,10 @@
Mutex::Autolock l(mLock);
p = mPlayer;
mClient.clear();
- mPlayer.clear();
}
+ mPlayer.clear();
+
// clear the notification to prevent callbacks to dead client
// and reset the player. We assume the player will serialize
// access to itself if necessary.
@@ -646,7 +621,7 @@
sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerType)
{
// determine if we have the right player type
- sp<MediaPlayerBase> p = getPlayer();
+ sp<MediaPlayerBase> p = mPlayer;
if ((p != NULL) && (p->playerType() != playerType)) {
ALOGV("delete player");
p.clear();
@@ -797,7 +772,6 @@
}
if (mStatus == OK) {
- Mutex::Autolock l(mLock);
mPlayer = p;
}
}
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 1cd7693..a569f5d 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -970,14 +970,6 @@
}
if (handle != nullptr) {
- ssize_t offset;
- size_t size;
- sp<IMemoryHeap> heap = frame->getMemory(&offset, &size);
- if (heap->getHeapID() != mMemoryHeapBase->getHeapID()) {
- ALOGE("%s: Mismatched heap ID, ignoring release (got %x, expected %x)",
- __FUNCTION__, heap->getHeapID(), mMemoryHeapBase->getHeapID());
- return;
- }
uint32_t batchSize = 0;
{
Mutex::Autolock autoLock(mBatchLock);
diff --git a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp
index 9a69226..6e70ded 100644
--- a/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp
+++ b/media/libstagefright/codecs/mpeg2dec/SoftMPEG2.cpp
@@ -89,10 +89,10 @@
}
-static ssize_t getMinTimestampIdx(OMX_S64 *pNTimeStamp, bool *pIsTimeStampValid) {
+static size_t getMinTimestampIdx(OMX_S64 *pNTimeStamp, bool *pIsTimeStampValid) {
OMX_S64 minTimeStamp = LLONG_MAX;
- ssize_t idx = -1;
- for (ssize_t i = 0; i < MAX_TIME_STAMPS; i++) {
+ int idx = -1;
+ for (size_t i = 0; i < MAX_TIME_STAMPS; i++) {
if (pIsTimeStampValid[i]) {
if (pNTimeStamp[i] < minTimeStamp) {
minTimeStamp = pNTimeStamp[i];
@@ -788,15 +788,10 @@
}
if (s_dec_op.u4_output_present) {
- ssize_t timeStampIdx;
+ size_t timeStampIdx;
outHeader->nFilledLen = (mWidth * mHeight * 3) / 2;
timeStampIdx = getMinTimestampIdx(mTimeStamps, mTimeStampsValid);
- if (timeStampIdx < 0) {
- ALOGE("b/62872863, Invalid timestamp index!");
- android_errorWriteLog(0x534e4554, "62872863");
- return;
- }
outHeader->nTimeStamp = mTimeStamps[timeStampIdx];
mTimeStampsValid[timeStampIdx] = false;
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp
index 1cf9744..f1b44ae 100644
--- a/media/libstagefright/mpeg2ts/ESQueue.cpp
+++ b/media/libstagefright/mpeg2ts/ESQueue.cpp
@@ -892,11 +892,6 @@
bits.skipBits(2);
unsigned aac_frame_length = bits.getBits(13);
- if (aac_frame_length == 0){
- ALOGE("b/62673179, Invalid AAC frame length!");
- android_errorWriteLog(0x534e4554, "62673179");
- return NULL;
- }
bits.skipBits(11); // adts_buffer_fullness
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 60eca7e..b4029c7 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -1334,24 +1334,6 @@
ALOGVV("command(), cmdCode: %d, mHasControl: %d, mEffect: %p",
cmdCode, mHasControl, mEffect.unsafe_get());
- // reject commands reserved for internal use by audio framework if coming from outside
- // of audioserver
- switch(cmdCode) {
- case EFFECT_CMD_ENABLE:
- case EFFECT_CMD_DISABLE:
- case EFFECT_CMD_SET_PARAM:
- case EFFECT_CMD_SET_PARAM_DEFERRED:
- case EFFECT_CMD_SET_PARAM_COMMIT:
- case EFFECT_CMD_GET_PARAM:
- break;
- default:
- if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY) {
- break;
- }
- android_errorWriteLog(0x534e4554, "62019992");
- return BAD_VALUE;
- }
-
if (cmdCode == EFFECT_CMD_ENABLE) {
if (*replySize < sizeof(int)) {
android_errorWriteLog(0x534e4554, "32095713");