From 3b0bf1e10b1870d73b1211d7d8a2d9200174209a Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 27 Oct 2015 18:20:57 +0800 Subject: [PATCH] for #512, make the segment more acceptable, when in [min, max_td * 2], it's ok. --- trunk/src/app/srs_app_hls.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 71360f6efd..fe10c48c7a 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -728,7 +728,8 @@ int SrsHlsMuxer::segment_close(string log_desc) // valid, add to segments if segment duration is ok // when too small, it maybe not enough data to play. // when too large, it maybe timestamp corrupt. - if (current->duration * 1000 >= SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS && (int)current->duration <= max_td) { + // make the segment more acceptable, when in [min, max_td * 2], it's ok. + if (current->duration * 1000 >= SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS && (int)current->duration <= max_td * 2) { segments.push_back(current); // use async to call the http hooks, for it will cause thread switch.