From 03c168eceeafbd40bf4d5538b55630e1ec518f43 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:45:20 +0100 Subject: [PATCH] [Nexus] Fix TV channels stuttering after wake from suspend - take 2 --- pvr.hts/addon.xml.in | 2 +- pvr.hts/changelog.txt | 3 +++ src/Tvheadend.cpp | 9 +++++---- src/tvheadend/HTSPDemuxer.cpp | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pvr.hts/addon.xml.in b/pvr.hts/addon.xml.in index ba163e27..d7726ffb 100644 --- a/pvr.hts/addon.xml.in +++ b/pvr.hts/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.hts/changelog.txt b/pvr.hts/changelog.txt index a9e193ac..8e4938fa 100644 --- a/pvr.hts/changelog.txt +++ b/pvr.hts/changelog.txt @@ -1,3 +1,6 @@ +v20.6.5 +- Fix TV channels stuttering after wake from suspend - take 2 + v20.6.4 - Fix TV channels stuttering after wake from suspend diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 861d5565..743a6b4b 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -1881,10 +1881,6 @@ void CTvheadend::SyncInitCompleted() return; /* Rebuild state */ - for (auto* dmx : m_dmx) - dmx->RebuildState(); - - m_vfs->RebuildState(); m_timeRecordings.RebuildState(); m_autoRecordings.RebuildState(); @@ -2021,6 +2017,11 @@ void CTvheadend::SyncEpgCompleted() void CTvheadend::SyncCompleted() { + for (auto* dmx : m_dmx) + dmx->RebuildState(); + + m_vfs->RebuildState(); + SyncEpgCompleted(); m_asyncState.SetState(ASYNC_DONE); diff --git a/src/tvheadend/HTSPDemuxer.cpp b/src/tvheadend/HTSPDemuxer.cpp index 906292c5..389e7196 100644 --- a/src/tvheadend/HTSPDemuxer.cpp +++ b/src/tvheadend/HTSPDemuxer.cpp @@ -62,6 +62,8 @@ void HTSPDemuxer::RebuildState() Logger::Log(LogLevel::LEVEL_DEBUG, "demux re-starting stream"); std::unique_lock lock(m_conn.Mutex()); + + m_subscription.SendUnsubscribe(lock); m_subscription.SendSubscribe(lock, 0, 0, true); m_subscription.SendSpeed(lock, 0, true);