dds=DVBSubtitleDisplayDefinition();
running = true;
+ paused = false;
dvbsThread = std::thread([this] { threadMethod(); });
}
running = false; // disables put()
+ paused = false;
signalStop = true;
dvbsCond.notify_one();
input_mutex.unlock();
return;
}
+ paused = true;
signalPause = true;
dvbsCond.notify_one();
input_mutex.unlock();
return;
}
+ paused = false;
signalRecalcWLTO = true;
dvbsCond.notify_one();
input_mutex.unlock();
else if (signalRecalcWLTO) // once per incoming packet, and other times
{
signalRecalcWLTO = false;
-#ifndef DVBSDEBUG
- ULLONG nowPTS = Video::getInstance()->getCurrentTimestamp();
-#endif
- if (nowPTS == 0)
+ if (paused)
{
- // Video is not started yet. DVBSub packet has come in. Don't set worklistTimeoutPoint,
- // just store the packet and allow next signal to start things off
- LogNT::getInstance()->debug(TAG, "signalRecalcWLTO but Video PTS == 0");
+ subtitleTimeoutPointActive = false;
+ worklistTimeoutPointActive = false;
}
- else if (worklist.size()) // It is possible to be called to recalc when there are no packets
+ else
{
- worklistTimeoutPointActive = true;
- LogNT::getInstance()->debug(TAG, "Calc: Num packets available: {}", worklist.size());
+ #ifndef DVBSDEBUG
+ ULLONG nowPTS = Video::getInstance()->getCurrentTimestamp();
+ #endif
- ULLONG pktPTS = worklist.front().getPTS();
- ULLONG diff = PTSDifference(pktPTS, nowPTS);
- diff /= 90; // convert diff to ms (PTS difference is in 1/90000s)
- if (diff < 60 * 1000)
+ if (nowPTS == 0)
{
- worklistTimeoutPoint = std::chrono::system_clock::now() + std::chrono::milliseconds(diff);
- LogNT::getInstance()->debug(TAG, "Calc'd new worklistTimeoutPoint");
+ // Video is not started yet. DVBSub packet has come in. Don't set worklistTimeoutPoint,
+ // just store the packet and allow next signal to start things off
+ LogNT::getInstance()->debug(TAG, "signalRecalcWLTO but Video PTS == 0");
}
- else
+ else if (worklist.size()) // It is possible to be called to recalc when there are no packets
{
- // We have a problem. An action so far in the future should have
- // been culled. Probably the action is already due and PTSDifference
- // wrapped around. Therefore we sleep for a minimal time instead.
+ worklistTimeoutPointActive = true;
+ LogNT::getInstance()->debug(TAG, "Calc: Num packets available: {}", worklist.size());
- // FIXME check if this still works
- worklistTimeoutPoint = std::chrono::system_clock::now();
- LogNT::getInstance()->debug(TAG, "Problem packet");
+ ULLONG pktPTS = worklist.front().getPTS();
+ ULLONG diff = PTSDifference(pktPTS, nowPTS);
+ diff /= 90; // convert diff to ms (PTS difference is in 1/90000s)
+ if (diff < 60 * 1000)
+ {
+ worklistTimeoutPoint = std::chrono::system_clock::now() + std::chrono::milliseconds(diff);
+ LogNT::getInstance()->debug(TAG, "Calc'd new worklistTimeoutPoint");
+ }
+ else
+ {
+ // We have a problem. An action so far in the future should have
+ // been culled. Probably the action is already due and PTSDifference
+ // wrapped around. Therefore we sleep for a minimal time instead.
+
+ // FIXME check if this still works
+ worklistTimeoutPoint = std::chrono::system_clock::now();
+ LogNT::getInstance()->debug(TAG, "Problem packet");
+ }
}
}
}