From b1740e9bd3450fbd389ee7a3bd1fe76ac21a20cc Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 20 Jan 2022 01:40:10 +0100 Subject: [PATCH] Fixed livepeer process disconnecting track 0 instead of actual track ID --- src/process/process_livepeer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/process/process_livepeer.cpp b/src/process/process_livepeer.cpp index 85ad12fc..70df4fc6 100644 --- a/src/process/process_livepeer.cpp +++ b/src/process/process_livepeer.cpp @@ -228,10 +228,11 @@ namespace Mist{ if (S.lastPacket >= statSinkMs){statSinkMs = S.lastPacket;} } trackId = (S.ID << 16) + thisPacket.getTrackId(); - size_t idx = M.trackIDToIndex(trackId, getpid()); - if (idx == INVALID_TRACK_ID || !M.getCodec(idx).size()){ + thisIdx = M.trackIDToIndex(trackId, getpid()); + if (thisIdx == INVALID_TRACK_ID || !M.getCodec(thisIdx).size()){ INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID); S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId); + thisIdx = M.trackIDToIndex(trackId, getpid()); } } if (S.byteOffset >= S.data.size() && !S.S.hasPacket()){ @@ -254,7 +255,8 @@ namespace Mist{ //overwrite trackID Bit::htobl(data + 8, trackId); //overwrite packettime - Bit::htobll(data + 12, thisPacket.getTime() + timeOffset); + thisTime = thisPacket.getTime() + timeOffset; + Bit::htobll(data + 12, thisTime); } } bool checkArguments(){return true;}