diff --git a/frameworks/js/avplayer/avplayer_napi.cpp b/frameworks/js/avplayer/avplayer_napi.cpp index ddd3b22510e81e379e18424576d1221d6414b4c2..9b53fa93a7c8ee0bf3a0b9d4e7322c51e540267e 100644 --- a/frameworks/js/avplayer/avplayer_napi.cpp +++ b/frameworks/js/avplayer/avplayer_napi.cpp @@ -1173,7 +1173,7 @@ napi_value AVPlayerNapi::JsGetUrl(napi_env env, napi_callback_info info) napi_value value = nullptr; (void)napi_create_string_utf8(env, jsPlayer->url_.c_str(), NAPI_AUTO_LENGTH, &value); - MEDIA_LOGI("JsGetUrl Out Current Url: %{public}s", jsPlayer->url_.c_str()); + MEDIA_LOGD("JsGetUrl Out Current Url: %{public}s", jsPlayer->url_.c_str()); return value; } diff --git a/services/engine/histreamer/player/hiplayer_impl.cpp b/services/engine/histreamer/player/hiplayer_impl.cpp index 445665bdec62a7e6587218d3be9e6df033c071af..e1ab3ea2ac16886ad0bf5e486e0af4d94483aa57 100755 --- a/services/engine/histreamer/player/hiplayer_impl.cpp +++ b/services/engine/histreamer/player/hiplayer_impl.cpp @@ -229,7 +229,11 @@ int HiPlayerImpl::PrepareAsync() return MSERR_INVALID_OPERATION; } if (pipelineStates_ == PlayerStates::PLAYER_STOPPED) { - SetSource(url_); + int32_t ret = SetSource(url_); + if (ret != MSERR_OK) { + OnStateChanged(PlayerStateId::ERROR); + return TransStatus(Status::ERROR_UNSUPPORTED_FORMAT); + } } NotifyBufferingUpdate(PlayerKeys::PLAYER_BUFFERING_START, 0); MEDIA_LOG_I("PrepareAsync entered, current pipeline state: " PUBLIC_LOG_S, @@ -714,6 +718,9 @@ int32_t HiPlayerImpl::GetCurrentTime(int32_t& currentPositionMs) int32_t HiPlayerImpl::GetDuration(int32_t& durationMs) { auto tmpMeta = demuxer_->GetGlobalMetaInfo(); + if (tmpMeta == nullptr) { + MEDIA_LOG_E("GetDuration failed, Meta is null."); + } sourceMeta_ = tmpMeta; int64_t duration = 0; bool found = false;