From 2f477a4ef902bddadef0677ec3a39183e54b727d Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 22 Jul 2017 19:07:16 +0200 Subject: [PATCH 1/2] Fixed audio key setting --- lib/defines.h | 1 + lib/dtscmeta.cpp | 2 -- src/io.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/defines.h b/lib/defines.h index 5e8c9fdf..ee864ecf 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -93,6 +93,7 @@ static inline void show_stackframe(){} #define SHM_DATASIZE 20 #endif +#define AUDIO_KEY_INTERVAL 5000 ///< This define controls the keyframe interval for non-video tracks, such as audio and metadata tracks. #ifndef STATS_DELAY #define STATS_DELAY 15 diff --git a/lib/dtscmeta.cpp b/lib/dtscmeta.cpp index 8be3f3e2..6f82daf5 100644 --- a/lib/dtscmeta.cpp +++ b/lib/dtscmeta.cpp @@ -6,8 +6,6 @@ #include #include -#define AUDIO_KEY_INTERVAL 5000 ///< This define controls the keyframe interval for non-video tracks, such as audio and metadata tracks. - namespace DTSC { /// Default constructor for packets - sets a null pointer and invalid packet. Packet::Packet() { diff --git a/src/io.cpp b/src/io.cpp index 2165c53f..68c7ac1f 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -453,7 +453,7 @@ namespace Mist { isKeyframe = true; } else { unsigned long lastKey = pagesByTrack[tid].rbegin()->second.lastKeyTime; - if (packet.getTime() - lastKey > 5000) { + if (packet.getTime() - lastKey > AUDIO_KEY_INTERVAL) { isKeyframe = true; } } From 791fc5eae9e208918a853c49a66df4f00693b0e9 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 5 Apr 2017 10:41:45 +0200 Subject: [PATCH 2/2] Added a define for live stream latency --- lib/defines.h | 3 +++ src/input/input.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/defines.h b/lib/defines.h index ee864ecf..c15c6f2a 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -121,6 +121,9 @@ static inline void show_stackframe(){} /// Does not affect live streams. #define FLIP_MIN_DURATION 20000 +/// Interval where the input refreshes the user data for stats etc. +#define INPUT_USER_INTERVAL 1000 + #define SHM_STREAM_INDEX "MstSTRM%s" //%s stream name #define SHM_STREAM_STATE "MstSTATE%s" //%s stream name #define STRMSTAT_OFF 0 diff --git a/src/input/input.cpp b/src/input/input.cpp index 90a37054..19d9c2be 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -309,7 +309,7 @@ namespace Mist { INSANE_MSG("Connected: %d users, %d total", userPage.connectedUsers, userPage.amount); //if not shutting down, wait 1 second before looping if (config->is_active){ - Util::wait(1000); + Util::wait(INPUT_USER_INTERVAL); } } if (streamStatus){streamStatus.mapped[0] = STRMSTAT_SHUTDOWN;}