From 2b8c7fa0bded8b746ec09fc574e2bcafe38696d5 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Thu, 20 Aug 2026 15:38:57 +0300 Subject: [PATCH] Fixed percentage statistics of servaVideoComposer --- Projects/la_serva/build | 2 +- lib/App/serva/servaVideoComposer.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Projects/la_serva/build b/Projects/la_serva/build index 8d62327c..7efee7e2 100755 --- a/Projects/la_serva/build +++ b/Projects/la_serva/build @@ -4,7 +4,7 @@ #make clean -e "CFG=Debug" #make -e "CFG=Debug" -j$(nproc) -make clean -e "CFG=Debug86" +#make clean -e "CFG=Debug86" make -e "CFG=Debug86" -j$(nproc) #make clean -e "CFG=Release86" diff --git a/lib/App/serva/servaVideoComposer.cpp b/lib/App/serva/servaVideoComposer.cpp index 35dd97f4..5f2e08c0 100644 --- a/lib/App/serva/servaVideoComposer.cpp +++ b/lib/App/serva/servaVideoComposer.cpp @@ -1664,11 +1664,14 @@ void servaVideoComposer::m_fThreadProc(void){ char tB[256]; m_bThreadStatus = TH_WORKING; + uint8_t perc = 0; + uint8_t operc = 0; for ( uint64_t CurrentTS = BeginnhingTS; CurrentTS < EndTS && m_bThreadStatus < TH_ENDED; CurrentTS += FramePT ) { - uint8_t perc = (uint8_t)(( CurrentTS - BeginnhingTS ) * 100 ) / ( EndTS - BeginnhingTS ); - - m_pDBC->updateMediaComposerItem( m_uComposerRecordId, 'L', perc ); - + uint8_t perc = (uint8_t)((( CurrentTS - BeginnhingTS ) * 100 ) / ( EndTS - BeginnhingTS )); + if ( operc != perc ) { + operc = perc; + m_pDBC->updateMediaComposerItem(m_uComposerRecordId, 'L', perc); + }; if( ( m_bComposerStatus & VIDEO_COMPOSER_LOK ) == VIDEO_COMPOSER_LOK ){ uint64_t csts = ((uint64_t)m_vLVideoQueue[L_idx]->sts ) * 1000 + m_vLVideoQueue[L_idx]->sms; if ( L_global_sts == 0 ) L_global_sts = csts;