diff --git a/src/io.cpp b/src/io.cpp index e539621e..13d6642d 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -303,6 +303,9 @@ namespace Mist { static bool multiWrong = false; //Save the trackid of the track for easier access unsigned long tid = pack.getTrackId(); + if (myMeta.live && pack.getTime() > 0xFFFF0000 && !myMeta.tracks[tid].lastms){ + return;//ignore bullshit timestamps + } if (myMeta.live && pack.getTime() < myMeta.tracks[tid].lastms){ DEBUG_MSG(multiWrong?DLVL_HIGH:DLVL_WARN, "Wrong order on track %lu ignored: %lu < %lu", tid, pack.getTime(), myMeta.tracks[tid].lastms); multiWrong = true; diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 40bac460..db847249 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -303,7 +303,7 @@ namespace Mist { //If there are now more selectable tracks, select the new track and do a seek to the current timestamp //Set sentHeader to false to force it to send init data - if (selectedTracks.size() < 2){ + if (myMeta.live && selectedTracks.size() < 2){ static unsigned long long lastMeta = 0; if (Util::epoch() > lastMeta + 5){ lastMeta = Util::epoch(); @@ -418,6 +418,7 @@ namespace Mist { data_len += dheader_len; unsigned int timestamp = thisPacket.getTime() - rtmpOffset; + if (rtmpOffset > thisPacket.getTime()){timestamp = 0;}//make sure we don't go negative bool allow_short = RTMPStream::lastsend.count(4); RTMPStream::Chunk & prev = RTMPStream::lastsend[4]; @@ -957,9 +958,10 @@ namespace Mist { amfreply.getContentP(3)->addContent(AMF::Object("description", "Playing!")); amfreply.getContentP(3)->addContent(AMF::Object("details", "DDV")); amfreply.getContentP(3)->addContent(AMF::Object("clientid", (double)1337)); - initialSeek(); - rtmpOffset = currentTime(); - amfreply.getContentP(3)->addContent(AMF::Object("timecodeOffset", (double)rtmpOffset)); + if (myMeta.live){ + rtmpOffset = currentTime(); + amfreply.getContentP(3)->addContent(AMF::Object("timecodeOffset", (double)rtmpOffset)); + } sendCommand(amfreply, playMessageType, playStreamId); RTMPStream::chunk_snd_max = 10240000; //10000KiB myConn.SendNow(RTMPStream::SendCTL(1, RTMPStream::chunk_snd_max)); //send chunk size max (msg 1)