From 78d69673f3e8fcbbb1f5f9f962c287d11234ebd0 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 25 Dec 2015 14:47:20 +0100 Subject: [PATCH] Fix HLS start issues for live streams. --- src/output/output_hls.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index af453b4c..055f209f 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -120,16 +120,15 @@ namespace Mist { if ( !myMeta.tracks.size()){ return 1; } - //loop trough all the tracks - for (std::map::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ - //return "too late" if one track is past this point - if (ms < it->second.firstms){ - return -1; - } - //return "too early" if one track is not yet at this point - if (ms > it->second.lastms){ - return 1; - } + //check main track + DTSC::Track & mainTrack = myMeta.tracks[*selectedTracks.begin()]; + //return "too late" if one track is past this point + if (ms < mainTrack.firstms){ + return -1; + } + //return "too early" if one track is not yet at this point + if (ms > mainTrack.lastms){ + return 1; } return 0; }