Simplified TS-SRT input to no longer add/remove a temporary track

This commit is contained in:
Thulinma 2021-12-30 14:49:54 +01:00
parent 840a1f5f4e
commit e73726a1c7
2 changed files with 2 additions and 9 deletions

View file

@ -201,7 +201,7 @@ namespace Mist{
}
tsStream.initializeMetadata(meta);
size_t thisIdx = M.trackIDToIndex(thisPacket.getTrackId(), getpid());
thisIdx = M.trackIDToIndex(thisPacket.getTrackId(), getpid());
if (thisIdx == INVALID_TRACK_ID){getNext(idx);}
uint64_t adjustTime = thisPacket.getTime() + timeStampOffset;
@ -219,13 +219,7 @@ namespace Mist{
bool inputTSSRT::openStreamSource(){return true;}
void inputTSSRT::parseStreamHeader(){
// Placeholder empty track to force normal code to continue despite no tracks available
tmpIdx = meta.addTrack(0, 0, 0, 0);
}
void inputTSSRT::streamMainLoop(){
meta.removeTrack(tmpIdx);
// If we do not have a srtConn here, we are the main thread and should start accepting pushes.
if (srtConn.getSocket() == -1){
cfgPointer = config;

View file

@ -28,9 +28,9 @@ namespace Mist{
virtual bool needHeader(){return false;}
virtual bool isSingular(){return singularFlag;}
virtual bool isThread(){return !singularFlag;}
virtual bool publishesTracks(){return false;}
bool openStreamSource();
void parseStreamHeader();
void streamMainLoop();
TS::Stream tsStream; ///< Used for parsing the incoming ts stream
TS::Packet tsBuf;
@ -40,7 +40,6 @@ namespace Mist{
Socket::SRTConnection srtConn;
bool singularFlag;
size_t tmpIdx;
virtual void connStats(Comms::Statistics &statComm);
};
}// namespace Mist