From 4eb0a7c56c5d0daeef491b1ffa771abd54cd32f4 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 22 Jul 2016 12:38:54 +0200 Subject: [PATCH] Fix RTMP buffering --- src/output/output.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/output/output.cpp b/src/output/output.cpp index 2670ba2e..139e1cdd 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -531,7 +531,7 @@ namespace Mist { /// This function decides where in the stream initial playback starts. /// The default implementation calls seek(0) for VoD. - /// For live, it seeks to the last sync'ed keyframe of the main track. + /// For live, it seeks to the last sync'ed keyframe of the main track, no closer than 2.5s from the end. /// Unless lastms < 5000, then it seeks to the first keyframe of the main track. /// Aborts if there is no main track or it has no keyframes. void Output::initialSeek(){ @@ -547,6 +547,7 @@ namespace Mist { bool good = true; //check if all tracks have data for this point in time for (std::set::iterator ti = selectedTracks.begin(); ti != selectedTracks.end(); ++ti){ + if (myMeta.tracks[*ti].lastms < seekPos+2500){good = false; break;} if (mainTrack == *ti){continue;}//skip self if (!myMeta.tracks.count(*ti)){ HIGH_MSG("Skipping track %lu, not in tracks", *ti);