[SCM] kodi-pvr-hts/master: demuxer - Seek - set m_seekTime variable to zero before Wait()

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 f2d5d965f65798b0b3fde740c7e1db250ace73ed
Author: Jaroslav Kysela <perex at perex.cz>
Date:   Fri Dec 18 20:37:55 2015 +0100

    demuxer - Seek - set m_seekTime variable to zero before Wait()
    
    It's really a fatal error. If the predicate is not set to zero,
    then _PredicateCallbackDefault() function (see platform/mutex.h)
    gives true return value. It means that Wait() returns ASAP.
    
    This also means that m_seekTime must not be set to a zero value
    in the ParseSubscriptionSkip().

diff --git a/src/HTSPDemuxer.cpp b/src/HTSPDemuxer.cpp
index f04a5e0..252b424 100644
--- a/src/HTSPDemuxer.cpp
+++ b/src/HTSPDemuxer.cpp
@@ -165,6 +165,7 @@ bool CHTSPDemuxer::Seek
   m_seeking = true;
 
   /* Wait for time */
+  m_seekTime = 0;
   if (!m_seekCond.Wait(m_conn.Mutex(), m_seekTime, Settings::GetInstance().GetResponseTimeout()))
   {
     Logger::Log(LogLevel::LEVEL_ERROR, "failed to get subscriptionSeek response");
@@ -178,7 +179,7 @@ bool CHTSPDemuxer::Seek
     return false;
 
   /* Store */
-  *startpts = TVH_TO_DVD_TIME(m_seekTime);
+  *startpts = TVH_TO_DVD_TIME(m_seekTime - 1);
   Logger::Log(LogLevel::LEVEL_TRACE, "demux seek startpts = %lf", *startpts);
 
   return true;
@@ -511,7 +512,7 @@ void CHTSPDemuxer::ParseSubscriptionSkip ( htsmsg_t *m )
   if (htsmsg_get_s64(m, "time", &s64)) {
     m_seekTime = INVALID_SEEKTIME;
   } else {
-    m_seekTime = s64;
+    m_seekTime = s64 < 0 ? 1 : s64 + 1; /* it must not be zero! */
   }
   Flush(); /* flush old packets (with wrong pts) */
   m_seekCond.Broadcast();

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list