From 393fa9e40334b93d0da71e9fe6591dc72bcc18b9 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Wed, 30 Nov 2022 16:56:04 +0100 Subject: [PATCH] Fixes timeout on slow loading VOD input --- src/input/input.cpp | 1 + src/session.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/input/input.cpp b/src/input/input.cpp index 782c1769..e56b4633 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -1482,6 +1482,7 @@ namespace Mist{ for (size_t i = 0; i < keyNum; ++i){partNo += keys.getParts(i);} DTSC::Parts parts(M.parts(idx)); while (thisPacket && thisTime < stopTime){ + if (connectedUsers){activityCounter = Util::bootSecs();} if (thisTime >= lastBuffered){ if (sourceIdx != idx){ if (encryption.find(":") != std::string::npos || M.getEncryption(idx).find(":") != std::string::npos){ diff --git a/src/session.cpp b/src/session.cpp index 59fb768c..f2026cc8 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -9,6 +9,7 @@ #include // Global counters +uint64_t thisType = 0; uint64_t now = Util::bootSecs(); uint64_t currentConnections = 0; uint64_t lastSecond = 0; @@ -44,7 +45,7 @@ const char nullAddress[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void userOnActive(Comms::Connections &connections, size_t idx){ uint64_t lastUpdate = connections.getNow(idx); - if (lastUpdate < now - 10){return;} + if (lastUpdate < now - 10 && thisType != 1){return;} ++currentConnections; std::string thisConnector = connections.getConnector(idx); std::string thisStreamName = connections.getStream(idx); @@ -235,7 +236,6 @@ int main(int argc, char **argv){ if (memcmp(thisHost.data(), nullAddress, 16)){hostLastActive[thisHost] = now;} // Determine session type, since triggers only get run for viewer type sessions - uint64_t thisType = 0; if (thisSessionId[0] == 'I'){ thisType = 1; } else if (thisSessionId[0] == 'O'){