Merge branch 'development' into LTS_development

# Conflicts:
#	CMakeLists.txt
#	lib/dtscmeta.cpp
#	lib/procs.cpp
#	lib/ts_packet.cpp
#	src/controller/controller_connectors.cpp
#	src/input/input_buffer.cpp
#	src/output/output_https.cpp
This commit is contained in:
Thulinma 2019-07-13 14:34:14 +02:00
commit 22a76f4ddb

View file

@ -761,7 +761,6 @@ namespace Mist {
std::string trackIdentifier = trackMeta.tracks.find(value)->second.getIdentifier(); std::string trackIdentifier = trackMeta.tracks.find(value)->second.getIdentifier();
DEBUG_MSG(DLVL_HIGH, "Attempting colision detection for track %s", trackIdentifier.c_str()); DEBUG_MSG(DLVL_HIGH, "Attempting colision detection for track %s", trackIdentifier.c_str());
/*LTS-START*/
//Get the identifier for the track, and attempt colission detection. //Get the identifier for the track, and attempt colission detection.
int collidesWith = -1; int collidesWith = -1;
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) { for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
@ -772,7 +771,6 @@ namespace Mist {
break; break;
} }
} }
/*LTS-END*/
//Remove the "negotiate" status in either case //Remove the "negotiate" status in either case
negotiatingTracks.erase(value); negotiatingTracks.erase(value);
//Set master to true before erasing the page, because we are responsible for cleaning up unused pages //Set master to true before erasing the page, because we are responsible for cleaning up unused pages
@ -785,12 +783,12 @@ namespace Mist {
WARN_MSG("Collision of temporary track %lu with existing track %d detected. Handling as a new valid track.", value, collidesWith); WARN_MSG("Collision of temporary track %lu with existing track %d detected. Handling as a new valid track.", value, collidesWith);
collidesWith = -1; collidesWith = -1;
} }
/*LTS-START*/
uint64_t finalMap = collidesWith; uint64_t finalMap = collidesWith;
if (finalMap == -1) { if (finalMap == -1) {
//No collision has been detected, assign a new final number //No collision has been detected, assign a new final number
finalMap = (myMeta.tracks.size() ? myMeta.tracks.rbegin()->first : 0) + 1; finalMap = (myMeta.tracks.size() ? myMeta.tracks.rbegin()->first : 0) + 1;
DEBUG_MSG(DLVL_DEVEL, "No colision detected for temporary track %lu from user %u, assigning final track number %lu", value, id, finalMap); DEBUG_MSG(DLVL_DEVEL, "No colision detected for temporary track %lu from user %u, assigning final track number %lu", value, id, finalMap);
/*LTS-START*/
if (Triggers::shouldTrigger("STREAM_TRACK_ADD")) { if (Triggers::shouldTrigger("STREAM_TRACK_ADD")) {
std::string payload = config->getString("streamname") + "\n" + JSON::Value(finalMap).asString() + "\n"; std::string payload = config->getString("streamname") + "\n" + JSON::Value(finalMap).asString() + "\n";
Triggers::doTrigger("STREAM_TRACK_ADD", payload, config->getString("streamname")); Triggers::doTrigger("STREAM_TRACK_ADD", payload, config->getString("streamname"));