From f03eba5367c91f300dae3420d7987e62b51d9095 Mon Sep 17 00:00:00 2001 From: gcw_ClGB9ada Date: Fri, 12 Sep 2025 11:26:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?dfx=E6=89=93=E7=82=B9AI-Review=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gcw_ClGB9ada --- services/utils/media_dfx.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/utils/media_dfx.cpp b/services/utils/media_dfx.cpp index ece7733db..fd308465a 100644 --- a/services/utils/media_dfx.cpp +++ b/services/utils/media_dfx.cpp @@ -226,7 +226,13 @@ void MediaEvent::CommonStatisicsEventWrite(CallType callType, OHOS::HiviewDFX::H eventInfoJson["mediaEvents"] = mediaEvents; { std::lock_guard lock(maxReportMut_); - eventInfoJson["maxInstanceNum"] = mediaMaxInstanceNumberMap_[callType][kv.first]; + auto it = mediaMaxInstanceNumberMap_[callType].find(kv.first); + if (it != mediaMaxInstanceNumberMap_[callType].end()) { + eventInfoJson["maxInstanceNum"] = it->second; + } else { + eventInfoJson["maxInstanceNum"] = 0; + } + } jsonArray.push_back(eventInfoJson); infoArr.push_back(jsonArray.dump()); @@ -489,6 +495,7 @@ int32_t ReportMediaInfo(uint64_t instanceId) void UpdateMaxInsNumberMap(CallType callType) { MEDIA_LOG_I("UpdateMaxInsNumberMap start."); + std::lock_guard lock(maxReportMut_); auto ctUidToMediaInfo = mediaInfoMap_.find(callType); if (ctUidToMediaInfo == mediaInfoMap_.end()) { return; -- Gitee From cad56a56150de98289120e2b4a742619c2b1f909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=A1=E4=B8=9C=E5=B3=B0?= Date: Fri, 12 Sep 2025 03:47:02 +0000 Subject: [PATCH 2/3] update services/utils/media_dfx.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 满东峰 --- services/utils/media_dfx.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/utils/media_dfx.cpp b/services/utils/media_dfx.cpp index fd308465a..53cb5c359 100644 --- a/services/utils/media_dfx.cpp +++ b/services/utils/media_dfx.cpp @@ -495,13 +495,17 @@ int32_t ReportMediaInfo(uint64_t instanceId) void UpdateMaxInsNumberMap(CallType callType) { MEDIA_LOG_I("UpdateMaxInsNumberMap start."); - std::lock_guard lock(maxReportMut_); auto ctUidToMediaInfo = mediaInfoMap_.find(callType); if (ctUidToMediaInfo == mediaInfoMap_.end()) { return; } - - auto& infoMap = mediaMaxInstanceNumberMap_.find(callType)->second; + + std::lock_guard lock(maxReportMut_); + auto it = mediaMaxInstanceNumberMap_.find(callType); + if (it == mediaMaxInstanceNumberMap_.end()) { + return; + } + auto& infoMap = it->second; std::vector keysToRemove; for (auto &info : infoMap) { int32_t uid = info.first; -- Gitee From 7ed5f044672fc300b3168d63a708d75ec544375a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=A1=E4=B8=9C=E5=B3=B0?= Date: Fri, 12 Sep 2025 03:47:53 +0000 Subject: [PATCH 3/3] update services/services/player/server/player_server.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 满东峰 --- services/services/player/server/player_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/services/player/server/player_server.cpp b/services/services/player/server/player_server.cpp index c377c3f77..ddfae32b4 100644 --- a/services/services/player/server/player_server.cpp +++ b/services/services/player/server/player_server.cpp @@ -1027,7 +1027,7 @@ int32_t PlayerServer::Seek(int32_t mSeconds, PlayerSeekMode mode) int32_t PlayerServer::HandleSeek(int32_t mSeconds, PlayerSeekMode mode) { - MEDIA_LOGI("KPI-TRACE: PlayerServer HandleSeek in, mSeconds: %{public}d, mSeconds: %{public}d", mSeconds, mode); + MEDIA_LOGI("KPI-TRACE: PlayerServer HandleSeek in, mSeconds: %{public}d, mode: %{public}d", mSeconds, mode); ExitSeekContinous(false); int32_t ret = playerEngine_->Seek(mSeconds, mode); CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, MSERR_INVALID_OPERATION, "Engine Seek Failed!"); -- Gitee