Added support for duration push parameter, fixed skipping forward in recordings
This commit is contained in:
parent
6d3eb861b8
commit
a071b365e5
1 changed files with 14 additions and 8 deletions
|
@ -1056,14 +1056,6 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (targetParams.count("recstop")){
|
|
||||||
long long endRec = atoll(targetParams["recstop"].c_str());
|
|
||||||
if (endRec < 0 || endRec < startTime()){
|
|
||||||
onFail("Entire recording range is in the past", true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
INFO_MSG("Recording will stop at %lld", endRec);
|
|
||||||
}
|
|
||||||
if (targetParams.count("recstart") && atoll(targetParams["recstart"].c_str()) != 0){
|
if (targetParams.count("recstart") && atoll(targetParams["recstart"].c_str()) != 0){
|
||||||
unsigned long int mainTrack = getMainSelectedTrack();
|
unsigned long int mainTrack = getMainSelectedTrack();
|
||||||
long long startRec = atoll(targetParams["recstart"].c_str());
|
long long startRec = atoll(targetParams["recstart"].c_str());
|
||||||
|
@ -1092,6 +1084,19 @@ namespace Mist{
|
||||||
INFO_MSG("Recording will start at %lld", startRec);
|
INFO_MSG("Recording will start at %lld", startRec);
|
||||||
seekPos = startRec;
|
seekPos = startRec;
|
||||||
}
|
}
|
||||||
|
//Duration to record in seconds. Overrides recstop.
|
||||||
|
if (targetParams.count("duration")){
|
||||||
|
long long endRec = atoll(targetParams["duration"].c_str())*1000;
|
||||||
|
targetParams["recstop"] = JSON::Value((int64_t)(seekPos + endRec)).asString();
|
||||||
|
}
|
||||||
|
if (targetParams.count("recstop")){
|
||||||
|
long long endRec = atoll(targetParams["recstop"].c_str());
|
||||||
|
if (endRec < 0 || endRec < startTime()){
|
||||||
|
onFail("Entire recording range is in the past", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
INFO_MSG("Recording will stop at %lld", endRec);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
if (myMeta.live && targetParams.count("pushdelay")){
|
if (myMeta.live && targetParams.count("pushdelay")){
|
||||||
INFO_MSG("Converting pushdelay syntax into corresponding startunix+realtime options");
|
INFO_MSG("Converting pushdelay syntax into corresponding startunix+realtime options");
|
||||||
|
@ -1182,6 +1187,7 @@ namespace Mist{
|
||||||
static uint32_t seekCount = 2;
|
static uint32_t seekCount = 2;
|
||||||
unsigned long long seekPos = 0;
|
unsigned long long seekPos = 0;
|
||||||
if (!myMeta.live){return false;}
|
if (!myMeta.live){return false;}
|
||||||
|
if (isRecordingToFile){return false;}
|
||||||
long unsigned int mainTrack = getMainSelectedTrack();
|
long unsigned int mainTrack = getMainSelectedTrack();
|
||||||
//cancel if there are no keys in the main track
|
//cancel if there are no keys in the main track
|
||||||
if (!myMeta.tracks.count(mainTrack)){return false;}
|
if (!myMeta.tracks.count(mainTrack)){return false;}
|
||||||
|
|
Loading…
Add table
Reference in a new issue