From ec78f92b8e68d9b18313dc040de2c1457b269a8f Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 11 Jul 2015 01:05:18 +0200 Subject: [PATCH] Allow setting of play back rate multiplier in MP4 output through the "rate" GET parameter. --- src/output/output_progressive_mp4.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/output/output_progressive_mp4.cpp b/src/output/output_progressive_mp4.cpp index a6ce0f0a..54a39fea 100644 --- a/src/output/output_progressive_mp4.cpp +++ b/src/output/output_progressive_mp4.cpp @@ -490,6 +490,16 @@ namespace Mist { maxSkipAhead = JSON::Value(H.GetVar("buffer")).asInt() * 1000; minSkipAhead = maxSkipAhead - std::min(2500u, maxSkipAhead / 2); } + //allow setting of play back rate through buffer variable. + //play back rate is set in MS per second, but the variable is a simple multiplier. + if (H.GetVar("rate") != ""){ + long long int multiplier = JSON::Value(H.GetVar("rate")).asInt(); + if (multiplier){ + realTime = 1000 / multiplier; + }else{ + realTime = 0; + } + } /*LTS-END*/ initialize(); parseData = true;