diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index 209ab0bd..31c7894f 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -103,14 +103,6 @@ namespace Mist { inputBuffer::~inputBuffer() { config->is_active = false; if (myMeta.tracks.size()) { - /*LTS-START*/ - if (myMeta.bufferWindow) { - if (Triggers::shouldTrigger("STREAM_BUFFER")) { - std::string payload = config->getString("streamname") + "\nEMPTY"; - Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname")); - } - } - /*LTS-END*/ DEBUG_MSG(DLVL_DEVEL, "Cleaning up, removing last keyframes"); for (std::map::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) { std::map & locations = bufferLocations[it->first]; @@ -432,6 +424,16 @@ namespace Mist { } void inputBuffer::finish() { + if (myMeta.tracks.size()) { + /*LTS-START*/ + if (myMeta.bufferWindow) { + if (Triggers::shouldTrigger("STREAM_BUFFER")) { + std::string payload = config->getString("streamname") + "\nEMPTY"; + Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname")); + } + } + /*LTS-END*/ + } Input::finish(); updateMeta(); if (bufferLocations.size()) {