[SCM] kodi-pvr-hts/master: demuxer - flush packet queue also on speed changes

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Wed Mar 2 23:01:58 UTC 2016


The following commit has been merged in the master branch:
commit e56d69f063aed99749c1f8d2fdc41995747f43c9
Author: Jaroslav Kysela <perex at perex.cz>
Date:   Sat Dec 19 16:03:42 2015 +0100

    demuxer - flush packet queue also on speed changes

diff --git a/src/HTSPDemuxer.cpp b/src/HTSPDemuxer.cpp
index 252b424..247c590 100644
--- a/src/HTSPDemuxer.cpp
+++ b/src/HTSPDemuxer.cpp
@@ -190,6 +190,10 @@ void CHTSPDemuxer::Speed ( int speed )
   CLockObject lock(m_conn.Mutex());
   if (!m_subscription.IsActive())
     return;
+  if (speed != m_subscription.GetSpeed() && (speed < 0 || speed >= 4000)) {
+    m_speedChange = true;
+    Flush();
+  }
   m_subscription.SendSpeed(speed);
 }
 
@@ -279,7 +283,7 @@ void CHTSPDemuxer::ParseMuxPacket ( htsmsg_t *m )
   size_t      binlen;
   DemuxPacket *pkt;
   char        _unused(type) = 0;
-  int         iStreamId;
+  int         iStreamId, ignore;
   
   /* Ignore packets while switching channels */
   if (!m_subscription.IsActive())
@@ -334,11 +338,17 @@ void CHTSPDemuxer::ParseMuxPacket ( htsmsg_t *m )
   if (!type)
     type = '_';
 
-  Logger::Log(LogLevel::LEVEL_TRACE, "demux pkt idx %d:%d type %c pts %lf len %lld",
-           idx, pkt->iStreamId, type, pkt->pts, (long long)binlen);
+  ignore = m_seeking || m_speedChange;
+
+  Logger::Log(LogLevel::LEVEL_TRACE, "demux pkt idx %d:%d type %c pts %lf len %lld%s",
+           idx, pkt->iStreamId, type, pkt->pts, (long long)binlen,
+           ignore ? " IGNORE" : "");
 
   /* Store */
-  m_pktBuffer.Push(pkt);
+  if (!ignore)
+    m_pktBuffer.Push(pkt);
+  else
+    PVR->FreeDemuxPacket(pkt);
 }
 
 void CHTSPDemuxer::ParseSubscriptionStart ( htsmsg_t *m )
@@ -523,6 +533,10 @@ void CHTSPDemuxer::ParseSubscriptionSpeed ( htsmsg_t *m )
   uint32_t u32;
   if (!htsmsg_get_u32(m, "speed", &u32))
     Logger::Log(LogLevel::LEVEL_TRACE, "recv speed %d", u32);
+  if (m_speedChange) {
+    Flush();
+    m_speedChange = false;
+  }
 }
 
 void CHTSPDemuxer::ParseQueueStatus ( htsmsg_t *_unused(m) )
diff --git a/src/Tvheadend.h b/src/Tvheadend.h
index 87f48d1..2ce4552 100644
--- a/src/Tvheadend.h
+++ b/src/Tvheadend.h
@@ -281,6 +281,7 @@ private:
   int64_t                                 m_seekTime;
   PLATFORM::CCondition<volatile int64_t>  m_seekCond;
   bool                                    m_seeking;
+  bool                                    m_speedChange;
   tvheadend::status::SourceInfo           m_sourceInfo;
   tvheadend::status::Quality              m_signalInfo;
   tvheadend::status::TimeshiftStatus      m_timeshiftStatus;

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list