From dc144e90d085ed12a39c99aaac3b9845f77d43d8 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 6 Sep 2014 13:16:06 +0200 Subject: [PATCH] Fixed HLS live last fragment being shown before completely being available. --- src/output/output_hls.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 6b36c6ae..37d080a9 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -70,7 +70,10 @@ namespace Mist { if (it != (myMeta.tracks[tid].fragments.end() - 1)){ result << "#EXTINF:" << ((it->getDuration() + 500) / 1000) << ", no desc\r\n" << starttime << "_" << it->getDuration() + starttime << ".ts\r\n"; } else { - result << "#EXTINF:" << ((myMeta.tracks[tid].lastms-starttime + 500) / 1000) << ", no desc\r\n" << starttime << "_" << myMeta.tracks[tid].lastms << ".ts\r\n"; + //only print the last segment when VoD + if (myMeta.vod){ + result << "#EXTINF:" << ((myMeta.tracks[tid].lastms-starttime + 500) / 1000) << ", no desc\r\n" << starttime << "_" << myMeta.tracks[tid].lastms << ".ts\r\n"; + } } } if ( !myMeta.live){