Tweaked several debug messages, backported a few Pro edition edits that were missed earlier
This commit is contained in:
parent
4dc3d22d12
commit
5ffe12aba4
3 changed files with 53 additions and 36 deletions
|
@ -120,7 +120,7 @@ namespace DTSC {
|
||||||
while (src.connected()){
|
while (src.connected()){
|
||||||
if (!toReceive && src.Received().available(8)){
|
if (!toReceive && src.Received().available(8)){
|
||||||
if (src.Received().copy(2) != "DT"){
|
if (src.Received().copy(2) != "DT"){
|
||||||
INFO_MSG("Invalid DTSC Packet header encountered (%s)", src.Received().copy(4).c_str());
|
WARN_MSG("Invalid DTSC Packet header encountered (%s)", src.Received().copy(4).c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
toReceive = Bit::btohl(src.Received().copy(8).data() + 4);
|
toReceive = Bit::btohl(src.Received().copy(8).data() + 4);
|
||||||
|
@ -131,10 +131,11 @@ namespace DTSC {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!src.spool()){
|
if(!src.spool()){
|
||||||
if (sleepCount++ > 60){
|
if (sleepCount++ > 50){
|
||||||
|
WARN_MSG("Waiting for packet on connection timed out");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util::sleep(100);
|
Util::wait(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,7 @@ namespace Mist {
|
||||||
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
||||||
nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
|
nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
|
||||||
|
|
||||||
DEBUG_MSG(DLVL_DEVEL, "Input for stream %s started", streamName.c_str());
|
INFO_MSG("Input for stream %s started", streamName.c_str());
|
||||||
|
|
||||||
if (!openStreamSource()){
|
if (!openStreamSource()){
|
||||||
FAIL_MSG("Unable to connect to source");
|
FAIL_MSG("Unable to connect to source");
|
||||||
|
@ -269,7 +269,7 @@ namespace Mist {
|
||||||
pullLock.post();
|
pullLock.post();
|
||||||
pullLock.close();
|
pullLock.close();
|
||||||
pullLock.unlink();
|
pullLock.unlink();
|
||||||
DEBUG_MSG(DLVL_DEVEL, "Pull input for stream %s closing clean", streamName.c_str());
|
INFO_MSG("Stream input %s closing clean", streamName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,12 +168,12 @@ namespace Mist {
|
||||||
std::cerr << "Input from stdin not yet supported" << std::endl;
|
std::cerr << "Input from stdin not yet supported" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!config->getString("streamname").size()){
|
if (!config->getString("streamname").size()) {
|
||||||
if (config->getString("output") == "-") {
|
if (config->getString("output") == "-") {
|
||||||
std::cerr << "Output to stdout not yet supported" << std::endl;
|
std::cerr << "Output to stdout not yet supported" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if (config->getString("output") != "-") {
|
if (config->getString("output") != "-") {
|
||||||
std::cerr << "File output in player mode not supported" << std::endl;
|
std::cerr << "File output in player mode not supported" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
@ -199,15 +199,15 @@ namespace Mist {
|
||||||
DTSC::File tmp(config->getString("input") + ".dtsh");
|
DTSC::File tmp(config->getString("input") + ".dtsh");
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
myMeta = tmp.getMeta();
|
myMeta = tmp.getMeta();
|
||||||
DEBUG_MSG(DLVL_HIGH,"Meta read in with %lu tracks", myMeta.tracks.size());
|
DEBUG_MSG(DLVL_HIGH, "Meta read in with %lu tracks", myMeta.tracks.size());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (inFile.getMeta().moreheader < 0 || inFile.getMeta().tracks.size() == 0) {
|
if (inFile.getMeta().moreheader < 0 || inFile.getMeta().tracks.size() == 0) {
|
||||||
DEBUG_MSG(DLVL_FAIL,"Missing external header file");
|
DEBUG_MSG(DLVL_FAIL, "Missing external header file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
myMeta = DTSC::Meta(inFile.getMeta());
|
myMeta = DTSC::Meta(inFile.getMeta());
|
||||||
DEBUG_MSG(DLVL_DEVEL,"Meta read in with %lu tracks", myMeta.tracks.size());
|
DEBUG_MSG(DLVL_DEVEL, "Meta read in with %lu tracks", myMeta.tracks.size());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::set<unsigned int>::iterator it = newTracks.begin(); it != newTracks.end(); it++){
|
for (std::set<unsigned int>::iterator it = newTracks.begin(); it != newTracks.end(); it++){
|
||||||
INFO_MSG("Adding track %d to internal metadata", *it);
|
INFO_MSG("Reset: adding track %d", *it);
|
||||||
myMeta.tracks[*it] = newMeta.tracks[*it];
|
myMeta.tracks[*it] = newMeta.tracks[*it];
|
||||||
continueNegotiate(*it, true);
|
continueNegotiate(*it, true);
|
||||||
}
|
}
|
||||||
|
@ -246,12 +246,12 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::set<unsigned int>::iterator it = deletedTracks.begin(); it != deletedTracks.end(); it++){
|
for(std::set<unsigned int>::iterator it = deletedTracks.begin(); it != deletedTracks.end(); it++){
|
||||||
INFO_MSG("Deleting track %d from internal metadata", *it);
|
INFO_MSG("Reset: deleting track %d", *it);
|
||||||
myMeta.tracks.erase(*it);
|
myMeta.tracks.erase(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read next packet before returning
|
//Read next packet before returning
|
||||||
thisPacket.reInit(srcConn);
|
return getNext(smart);
|
||||||
}else{
|
}else{
|
||||||
myMeta = DTSC::Meta();
|
myMeta = DTSC::Meta();
|
||||||
}
|
}
|
||||||
|
@ -259,11 +259,27 @@ namespace Mist {
|
||||||
//Read next packet before returning
|
//Read next packet before returning
|
||||||
thisPacket.reInit(srcConn);
|
thisPacket.reInit(srcConn);
|
||||||
}
|
}
|
||||||
|
}else if (thisPacket.getVersion() == DTSC::DTSC_HEAD){
|
||||||
|
DTSC::Meta newMeta;
|
||||||
|
newMeta.reinit(thisPacket);
|
||||||
|
std::set<unsigned int> newTracks;
|
||||||
|
for (std::map<unsigned int, DTSC::Track>::iterator it = newMeta.tracks.begin(); it != newMeta.tracks.end(); it++){
|
||||||
|
if (!myMeta.tracks.count(it->first)){
|
||||||
|
newTracks.insert(it->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::set<unsigned int>::iterator it = newTracks.begin(); it != newTracks.end(); it++){
|
||||||
|
INFO_MSG("New header: adding track %d (%s)", *it, newMeta.tracks[*it].type.c_str());
|
||||||
|
myMeta.tracks[*it] = newMeta.tracks[*it];
|
||||||
|
continueNegotiate(*it, true);
|
||||||
|
}
|
||||||
|
return getNext(smart);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if (smart){
|
if (smart) {
|
||||||
inFile.seekNext();
|
inFile.seekNext();
|
||||||
}else{
|
} else {
|
||||||
inFile.parseNext();
|
inFile.parseNext();
|
||||||
}
|
}
|
||||||
thisPacket = inFile.getPacket();
|
thisPacket = inFile.getPacket();
|
||||||
|
|
Loading…
Add table
Reference in a new issue