diff options
-rw-r--r-- | drm/mediadrm/plugins/mock/Android.mk | 3 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp | 4 | ||||
-rwxr-xr-x | libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp | 4 | ||||
-rw-r--r-- | media/libeffects/downmix/EffectDownmix.c | 4 | ||||
-rw-r--r-- | media/libeffects/visualizer/EffectVisualizer.cpp | 69 | ||||
-rwxr-xr-x | media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c | 10 | ||||
-rw-r--r-- | media/libstagefright/httplive/LiveSession.cpp | 14 | ||||
-rw-r--r-- | media/libstagefright/httplive/LiveSession.h | 3 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 3 |
10 files changed, 67 insertions, 51 deletions
diff --git a/drm/mediadrm/plugins/mock/Android.mk b/drm/mediadrm/plugins/mock/Android.mk index ada23a2..26c245b 100644 --- a/drm/mediadrm/plugins/mock/Android.mk +++ b/drm/mediadrm/plugins/mock/Android.mk @@ -21,7 +21,8 @@ LOCAL_SRC_FILES:= \ LOCAL_MODULE := libmockdrmcryptoplugin -LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/mediadrm +LOCAL_PROPRIETARY_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := mediadrm LOCAL_SHARED_LIBRARIES := \ libutils liblog diff --git a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp index e503936..cb4b23e 100755 --- a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp +++ b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp @@ -701,8 +701,8 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) { mBGAudioPCMFileOriginalSeekPoint <= (mBGAudioPCMFileTrimmedLength - len)) { - ALOGV("Checking mBGAudioPCMFileHandle %d", - (unsigned int)mBGAudioPCMFileHandle); + ALOGV("Checking mBGAudioPCMFileHandle %p", + mBGAudioPCMFileHandle); if (mBGAudioPCMFileHandle != M4OSA_NULL) { ALOGV("fillBuffer seeking file to %lld", diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp index af53c54..2e0d05d 100755 --- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp +++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp @@ -334,8 +334,8 @@ M4OSA_ERR VideoEditorMp3Reader_setOption(M4OSA_Context context, (VideoEditorMp3Reader_Context*)context; M4OSA_ERR err = M4NO_ERROR; - ALOGV("VideoEditorMp3Reader_Context begin: optionId: %d Value: %d ", - (int)optionId,(int)pValue); + ALOGV("VideoEditorMp3Reader_Context begin: optionId: %u Value: %p ", + optionId, pValue); M4OSA_DEBUG_IF1((M4OSA_NULL == pReaderContext), M4ERR_PARAMETER, "invalid context pointer"); diff --git a/media/libeffects/downmix/EffectDownmix.c b/media/libeffects/downmix/EffectDownmix.c index 3b25a2f..a39d837 100644 --- a/media/libeffects/downmix/EffectDownmix.c +++ b/media/libeffects/downmix/EffectDownmix.c @@ -629,7 +629,9 @@ int Downmix_Configure(downmix_module_t *pDwmModule, effect_config_t *pConfig, bo return -EINVAL; } - memcpy(&pDwmModule->config, pConfig, sizeof(effect_config_t)); + if (&pDwmModule->config != pConfig) { + memcpy(&pDwmModule->config, pConfig, sizeof(effect_config_t)); + } if (init) { pDownmixer->type = DOWNMIX_TYPE_FOLD; diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp index 2d66eef..5bdaa03 100644 --- a/media/libeffects/visualizer/EffectVisualizer.cpp +++ b/media/libeffects/visualizer/EffectVisualizer.cpp @@ -544,56 +544,57 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, break; - case VISUALIZER_CMD_CAPTURE: - if (pReplyData == NULL || *replySize != pContext->mCaptureSize) { - ALOGV("VISUALIZER_CMD_CAPTURE() error *replySize %d pContext->mCaptureSize %d", - *replySize, pContext->mCaptureSize); + case VISUALIZER_CMD_CAPTURE: { + int32_t captureSize = pContext->mCaptureSize; + if (pReplyData == NULL || *replySize != captureSize) { + ALOGV("VISUALIZER_CMD_CAPTURE() error *replySize %d captureSize %d", + *replySize, captureSize); return -EINVAL; } if (pContext->mState == VISUALIZER_STATE_ACTIVE) { - int32_t latencyMs = pContext->mLatency; const uint32_t deltaMs = Visualizer_getDeltaTimeMsFromUpdatedTime(pContext); - latencyMs -= deltaMs; - if (latencyMs < 0) { - latencyMs = 0; - } - const uint32_t deltaSmpl = pContext->mConfig.inputCfg.samplingRate * latencyMs / 1000; - - int32_t capturePoint = pContext->mCaptureIdx - pContext->mCaptureSize - deltaSmpl; - int32_t captureSize = pContext->mCaptureSize; - if (capturePoint < 0) { - int32_t size = -capturePoint; - if (size > captureSize) { - size = captureSize; - } - memcpy(pReplyData, - pContext->mCaptureBuf + CAPTURE_BUF_SIZE + capturePoint, - size); - pReplyData = (char *)pReplyData + size; - captureSize -= size; - capturePoint = 0; - } - memcpy(pReplyData, - pContext->mCaptureBuf + capturePoint, - captureSize); - // if audio framework has stopped playing audio although the effect is still // active we must clear the capture buffer to return silence if ((pContext->mLastCaptureIdx == pContext->mCaptureIdx) && - (pContext->mBufferUpdateTime.tv_sec != 0)) { - if (deltaMs > MAX_STALL_TIME_MS) { + (pContext->mBufferUpdateTime.tv_sec != 0) && + (deltaMs > MAX_STALL_TIME_MS)) { ALOGV("capture going to idle"); pContext->mBufferUpdateTime.tv_sec = 0; - memset(pReplyData, 0x80, pContext->mCaptureSize); + memset(pReplyData, 0x80, captureSize); + } else { + int32_t latencyMs = pContext->mLatency; + latencyMs -= deltaMs; + if (latencyMs < 0) { + latencyMs = 0; } + const uint32_t deltaSmpl = + pContext->mConfig.inputCfg.samplingRate * latencyMs / 1000; + int32_t capturePoint = pContext->mCaptureIdx - captureSize - deltaSmpl; + + if (capturePoint < 0) { + int32_t size = -capturePoint; + if (size > captureSize) { + size = captureSize; + } + memcpy(pReplyData, + pContext->mCaptureBuf + CAPTURE_BUF_SIZE + capturePoint, + size); + pReplyData = (char *)pReplyData + size; + captureSize -= size; + capturePoint = 0; + } + memcpy(pReplyData, + pContext->mCaptureBuf + capturePoint, + captureSize); } + pContext->mLastCaptureIdx = pContext->mCaptureIdx; } else { - memset(pReplyData, 0x80, pContext->mCaptureSize); + memset(pReplyData, 0x80, captureSize); } - break; + } break; case VISUALIZER_CMD_MEASURE: { uint16_t peakU16 = 0; diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c index 15eabfb..52c85e5 100755 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c @@ -1110,7 +1110,7 @@ void Intra16x16PlanePrediction(u8 *data, u8 *above, u8 *left) /* Variables */ - u32 i, j; + i32 i, j; i32 a, b, c; i32 tmp; @@ -1123,20 +1123,20 @@ void Intra16x16PlanePrediction(u8 *data, u8 *above, u8 *left) a = 16 * (above[15] + left[15]); for (i = 0, b = 0; i < 8; i++) - b += ((i32)i + 1) * (above[8+i] - above[6-i]); + b += (i + 1) * (above[8+i] - above[6-i]); b = (5 * b + 32) >> 6; for (i = 0, c = 0; i < 7; i++) - c += ((i32)i + 1) * (left[8+i] - left[6-i]); + c += (i + 1) * (left[8+i] - left[6-i]); /* p[-1,-1] has to be accessed through above pointer */ - c += ((i32)i + 1) * (left[8+i] - above[-1]); + c += (i + 1) * (left[8+i] - above[-1]); c = (5 * c + 32) >> 6; for (i = 0; i < 16; i++) { for (j = 0; j < 16; j++) { - tmp = (a + b * ((i32)j - 7) + c * ((i32)i - 7) + 16) >> 5; + tmp = (a + b * (j - 7) + c * (i - 7) + 16) >> 5; data[i*16+j] = (u8)CLIP1(tmp); } } diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index 233db44..fc1353a 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -514,7 +514,8 @@ sp<PlaylistFetcher> LiveSession::addFetcher(const char *uri) { status_t LiveSession::fetchFile( const char *url, sp<ABuffer> *out, - int64_t range_offset, int64_t range_length) { + int64_t range_offset, int64_t range_length, + String8 *actualUrl) { *out = NULL; sp<DataSource> source; @@ -599,6 +600,12 @@ status_t LiveSession::fetchFile( } *out = buffer; + if (actualUrl != NULL) { + *actualUrl = source->getUri(); + if (actualUrl->isEmpty()) { + *actualUrl = url; + } + } return OK; } @@ -610,7 +617,8 @@ sp<M3UParser> LiveSession::fetchPlaylist( *unchanged = false; sp<ABuffer> buffer; - status_t err = fetchFile(url, &buffer); + String8 actualUrl; + status_t err = fetchFile(url, &buffer, 0, -1, &actualUrl); if (err != OK) { return NULL; @@ -641,7 +649,7 @@ sp<M3UParser> LiveSession::fetchPlaylist( #endif sp<M3UParser> playlist = - new M3UParser(url, buffer->data(), buffer->size()); + new M3UParser(actualUrl.string(), buffer->data(), buffer->size()); if (playlist->initCheck() != OK) { ALOGE("failed to parse .m3u8 playlist"); diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h index 99b480a8..8f6a4ea 100644 --- a/media/libstagefright/httplive/LiveSession.h +++ b/media/libstagefright/httplive/LiveSession.h @@ -147,7 +147,8 @@ private: status_t fetchFile( const char *url, sp<ABuffer> *out, - int64_t range_offset = 0, int64_t range_length = -1); + int64_t range_offset = 0, int64_t range_length = -1, + String8 *actualUrl = NULL); sp<M3UParser> fetchPlaylist( const char *url, uint8_t *curPlaylistHash, bool *unchanged); diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index e9c38e3..26dac95 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -513,6 +513,8 @@ sp<IAudioTrack> AudioFlinger::createTrack( track = thread->createTrack_l(client, streamType, sampleRate, format, channelMask, frameCount, sharedBuffer, lSessionId, flags, tid, clientUid, &lStatus); + LOG_ALWAYS_FATAL_IF((lStatus == NO_ERROR) && (track == 0)); + // we don't abort yet if lStatus != NO_ERROR; there is still work to be done regardless // move effect chain to this output thread if an effect on same session was waiting // for a track to be created @@ -1291,7 +1293,7 @@ sp<IAudioRecord> AudioFlinger::openRecord( frameCount, lSessionId, IPCThreadState::self()->getCallingUid(), flags, tid, &lStatus); - LOG_ALWAYS_FATAL_IF((recordTrack != 0) != (lStatus == NO_ERROR)); + LOG_ALWAYS_FATAL_IF((lStatus == NO_ERROR) && (recordTrack == 0)); } if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the RecordTrack so that the diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 498ddb6..1da5147 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1326,6 +1326,7 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrac } if (track == 0 || track->getCblk() == NULL || track->name() < 0) { lStatus = NO_MEMORY; + // track must be cleared from the caller as the caller has the AF lock goto Exit; } @@ -4741,7 +4742,7 @@ sp<AudioFlinger::RecordThread::RecordTrack> AudioFlinger::RecordThread::createR if (track->getCblk() == 0) { ALOGE("createRecordTrack_l() no control block"); lStatus = NO_MEMORY; - track.clear(); + // track must be cleared from the caller as the caller has the AF lock goto Exit; } mTracks.add(track); |