diff --git a/pvr.hts/addon.xml.in b/pvr.hts/addon.xml.in index ba86f7ed..8b4c09d5 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 d95b1d61..c62ce6fe 100644 --- a/pvr.hts/changelog.txt +++ b/pvr.hts/changelog.txt @@ -1,3 +1,6 @@ +v21.1.2 +- Fix TV channels stuttering after wake from suspend - take 2 + v21.1.1 - Fix TV channels stuttering after wake from suspend diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 861d5565..7edd0cf2 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -1503,6 +1503,7 @@ bool CTvheadend::Connected(std::unique_lock& lock) else htsmsg_add_u32(msg, "epg", 0); + m_stateRebuilt = false; msg = m_conn->SendAndWait0(lock, "enableAsyncMetadata", msg); if (!msg) { @@ -1876,15 +1877,21 @@ void CTvheadend::PushEpgEventUpdate(const Event& epg, EPG_EVENT_STATE state) void CTvheadend::SyncInitCompleted() { + if (!m_stateRebuilt) + { + m_stateRebuilt = true; + + for (auto* dmx : m_dmx) + dmx->RebuildState(); + + m_vfs->RebuildState(); + } + /* check state engine */ if (m_asyncState.GetState() != ASYNC_INIT) return; /* Rebuild state */ - for (auto* dmx : m_dmx) - dmx->RebuildState(); - - m_vfs->RebuildState(); m_timeRecordings.RebuildState(); m_autoRecordings.RebuildState(); diff --git a/src/Tvheadend.h b/src/Tvheadend.h index d7a49679..1a57b84f 100644 --- a/src/Tvheadend.h +++ b/src/Tvheadend.h @@ -270,6 +270,7 @@ class ATTR_DLL_LOCAL CTvheadend : public kodi::addon::CInstancePVRClient, tvheadend::HTSPDemuxer* m_dmx_active; bool m_streamchange; tvheadend::HTSPVFS* m_vfs; + bool m_stateRebuilt{false}; HTSPMessageQueue m_queue; 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);