Skip to content

Commit 54ee2c7

Browse files
committed
Add "RECORDING_SEGMENT" trigger to notify on completed DVR segment
1 parent 22762f7 commit 54ee2c7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/output/output.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,11 @@ namespace Mist{
20832083
}
20842084
}
20852085

2086+
if (isRecordingToFile && Triggers::shouldTrigger("RECORDING_SEGMENT", streamName)){
2087+
std::string payload = streamName + "\n" + currentTarget + "\n" + JSON::Value(lastPacketTime - currentStartTime).asString() + "\n" + JSON::Value(currentStartTime).asString() + "\n" + JSON::Value(lastPacketTime).asString();
2088+
Triggers::doTrigger("RECORDING_SEGMENT", payload, streamName);
2089+
}
2090+
20862091
// Keep track of filenames written, so that they can be added to the playlist file
20872092
std::string newTarget;
20882093
if (targetParams.count("segment")){
@@ -2174,6 +2179,10 @@ namespace Mist{
21742179
if (myConn && myConn.isChunkedMode()) { myConn.SendNow(0, 0); }
21752180

21762181
/*LTS-START*/
2182+
if (isRecordingToFile && Triggers::shouldTrigger("RECORDING_SEGMENT", streamName)){
2183+
std::string payload = streamName + "\n" + currentTarget + "\n" + JSON::Value(lastPacketTime - currentStartTime).asString() + "\n" + JSON::Value(currentStartTime).asString() + "\n" + JSON::Value(lastPacketTime).asString();
2184+
Triggers::doTrigger("RECORDING_SEGMENT", payload, streamName);
2185+
}
21772186
if (Triggers::shouldTrigger("CONN_CLOSE", streamName)){
21782187
std::string payload =
21792188
streamName + "\n" + getConnectedHost() + "\n" + capa["name"].asStringRef() + "\n" + reqUrl;

0 commit comments

Comments
 (0)