Implemented STREAM_BUFFER RECOVER state.
This commit is contained in:
parent
91c226e4af
commit
b77e7c8b7c
1 changed files with 8 additions and 1 deletions
|
@ -237,6 +237,7 @@ namespace Mist {
|
||||||
/// FULL or EMPTY (depending on current state)
|
/// FULL or EMPTY (depending on current state)
|
||||||
/// ~~~~~~~~~~~~~~~
|
/// ~~~~~~~~~~~~~~~
|
||||||
void inputBuffer::updateMeta() {
|
void inputBuffer::updateMeta() {
|
||||||
|
static bool wentDry = false;
|
||||||
static long long unsigned int lastFragCount = 0xFFFFull;
|
static long long unsigned int lastFragCount = 0xFFFFull;
|
||||||
long long unsigned int firstms = 0xFFFFFFFFFFFFFFFFull;
|
long long unsigned int firstms = 0xFFFFFFFFFFFFFFFFull;
|
||||||
long long unsigned int lastms = 0;
|
long long unsigned int lastms = 0;
|
||||||
|
@ -267,7 +268,12 @@ namespace Mist {
|
||||||
/*LTS-START*/
|
/*LTS-START*/
|
||||||
if (fragCount >= FRAG_BOOT && fragCount != 0xFFFFull && (lastFragCount == 0xFFFFull || lastFragCount < FRAG_BOOT)) {
|
if (fragCount >= FRAG_BOOT && fragCount != 0xFFFFull && (lastFragCount == 0xFFFFull || lastFragCount < FRAG_BOOT)) {
|
||||||
if (Triggers::shouldTrigger("STREAM_BUFFER")) {
|
if (Triggers::shouldTrigger("STREAM_BUFFER")) {
|
||||||
std::string payload = config->getString("streamname") + "\nFULL";
|
std::string payload;
|
||||||
|
if (wentDry){
|
||||||
|
payload = config->getString("streamname") + "\nRECOVER";
|
||||||
|
}else{
|
||||||
|
payload = config->getString("streamname") + "\nFULL";
|
||||||
|
}
|
||||||
Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname"));
|
Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,6 +281,7 @@ namespace Mist {
|
||||||
if (Triggers::shouldTrigger("STREAM_BUFFER")) {
|
if (Triggers::shouldTrigger("STREAM_BUFFER")) {
|
||||||
std::string payload = config->getString("streamname") + "\nDRY";
|
std::string payload = config->getString("streamname") + "\nDRY";
|
||||||
Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname"));
|
Triggers::doTrigger("STREAM_BUFFER", payload, config->getString("streamname"));
|
||||||
|
wentDry = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastFragCount = fragCount;
|
lastFragCount = fragCount;
|
||||||
|
|
Loading…
Add table
Reference in a new issue