diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h index 221eb9469d3bce0a6487073a1f957ac39f299290..c3562a1325c77abe402ca62c0ddbb822aaf0f7da 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h @@ -116,9 +116,6 @@ private: bool firstOpenFlag_ = true; int64_t frameIndex_ = 0; - int64_t framePeriodNs_ = 0; - int64_t startTime_ = 0; - std::mutex volMtx_; uint32_t vol_ = 0; uint32_t volMax_ = 0; diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp index 50f6113051974d134ce85110602c4811cb3546ae..a2681d5a500dea6e5f2d59c3b5ea5d94be793545 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp @@ -39,10 +39,8 @@ AudioRenderInterfaceImpl::AudioRenderInterfaceImpl(const std::string &adpName, c devAttrs_(attrs), audioExtCallback_(callback) { devAttrs_.frameSize = CalculateFrameSize(attrs.sampleRate, attrs.channelCount, attrs.format, timeInterval_, false); - const int32_t sizePerSec = static_cast(attrs.sampleRate * attrs.channelCount) *attrs.format; - framePeriodNs_ = (static_cast(devAttrs_.frameSize) * AUDIO_NS_PER_SECOND) /sizePerSec; - DHLOGD("Distributed audio render constructed, period(%d), frameSize(%d), framePeriodNs_(%d).", - attrs.period, devAttrs_.frameSize, framePeriodNs_); + DHLOGD("Distributed audio render constructed, period(%d), frameSize(%d).", + attrs.period, devAttrs_.frameSize); } AudioRenderInterfaceImpl::~AudioRenderInterfaceImpl() @@ -92,8 +90,7 @@ int32_t AudioRenderInterfaceImpl::RenderFrame(const std::vector &frame, { DHLOGD("Render frame[sampleRate: %u, channelCount: %u, format: %d, frameSize: %u].", devAttrs_.sampleRate, devAttrs_.channelCount, devAttrs_.format, devAttrs_.frameSize); - int64_t timeOffset = UpdateTimeOffset(frameIndex_, framePeriodNs_, startTime_); - DHLOGD("Render frameIndex: %lld, timeOffset: %lld.", frameIndex_, timeOffset); + DHLOGD("Render frameIndex: %lld.", frameIndex_); std::lock_guard renderLck(renderMtx_); if (renderStatus_ != RENDER_STATUS_START) { @@ -115,7 +112,6 @@ int32_t AudioRenderInterfaceImpl::RenderFrame(const std::vector &frame, } ++frameIndex_; - AbsoluteSleep(startTime_ + frameIndex_ * framePeriodNs_ - timeOffset); DHLOGD("Render audio frame success."); return HDF_SUCCESS; } @@ -194,7 +190,6 @@ int32_t AudioRenderInterfaceImpl::Start() renderStatus_ = RENDER_STATUS_START; currentFrame_ = CUR_FRAME_INIT_VALUE; frameIndex_ = 0; - startTime_ = 0; return HDF_SUCCESS; }