Merge branch 'development' into LTS_development
# Conflicts: # src/input/input_dtsc.cpp # src/output/output.cpp
This commit is contained in:
commit
2294fbd365
7 changed files with 22 additions and 11 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -766,6 +766,10 @@ namespace IPC {
|
||||||
DEBUG_MSG(DLVL_FAIL, "Creating semaphore failed: %s", strerror(errno));
|
DEBUG_MSG(DLVL_FAIL, "Creating semaphore failed: %s", strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!mySemaphore.tryWaitOneSecond()){
|
||||||
|
WARN_MSG("Force unlocking sharedServer semaphore to prevent deadlock");
|
||||||
|
}
|
||||||
|
mySemaphore.post();
|
||||||
semGuard tmpGuard(&mySemaphore);
|
semGuard tmpGuard(&mySemaphore);
|
||||||
newPage();
|
newPage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,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");
|
||||||
|
@ -318,7 +318,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -787,6 +787,7 @@ namespace Mist {
|
||||||
//Store a reference for easier access
|
//Store a reference for easier access
|
||||||
std::map<unsigned long, DTSCPageData> & locations = bufferLocations[tNum];
|
std::map<unsigned long, DTSCPageData> & locations = bufferLocations[tNum];
|
||||||
char * mappedPointer = nProxy.metaPages[tNum].mapped;
|
char * mappedPointer = nProxy.metaPages[tNum].mapped;
|
||||||
|
if (!mappedPointer){return;}
|
||||||
|
|
||||||
//First detect all entries on metaPage
|
//First detect all entries on metaPage
|
||||||
for (int i = 0; i < 8192; i += 8) {
|
for (int i = 0; i < 8192; i += 8) {
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -270,11 +270,11 @@ 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("New header: adding track %d (%s)", *it, newMeta.tracks[*it].type.c_str());
|
||||||
myMeta.tracks[*it] = newMeta.tracks[*it];
|
myMeta.tracks[*it] = newMeta.tracks[*it];
|
||||||
continueNegotiate(*it, true);
|
continueNegotiate(*it, true);
|
||||||
}
|
}
|
||||||
thisPacket.reInit(srcConn);
|
return getNext(smart);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if (smart) {
|
if (smart) {
|
||||||
|
|
|
@ -68,6 +68,10 @@ namespace Mist {
|
||||||
myConn.setBlocking(isBlocking);
|
myConn.setBlocking(isBlocking);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t Output::currTrackCount() const{
|
||||||
|
return buffer.size();
|
||||||
|
}
|
||||||
|
|
||||||
void Output::updateMeta(){
|
void Output::updateMeta(){
|
||||||
//read metadata from page to myMeta variable
|
//read metadata from page to myMeta variable
|
||||||
if (nProxy.metaPages[0].mapped){
|
if (nProxy.metaPages[0].mapped){
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace Mist {
|
||||||
void selectDefaultTracks();
|
void selectDefaultTracks();
|
||||||
bool connectToFile(std::string file);
|
bool connectToFile(std::string file);
|
||||||
static bool listenMode(){return true;}
|
static bool listenMode(){return true;}
|
||||||
|
uint32_t currTrackCount() const;
|
||||||
virtual bool isReadyForPlay();
|
virtual bool isReadyForPlay();
|
||||||
//virtuals. The optional virtuals have default implementations that do as little as possible.
|
//virtuals. The optional virtuals have default implementations that do as little as possible.
|
||||||
virtual void sendNext() {}//REQUIRED! Others are optional.
|
virtual void sendNext() {}//REQUIRED! Others are optional.
|
||||||
|
|
Loading…
Add table
Reference in a new issue