winlin

for #512, make the segment more acceptable, when in [min, max_td * 2], it's ok.

@@ -728,7 +728,8 @@ int SrsHlsMuxer::segment_close(string log_desc) @@ -728,7 +728,8 @@ int SrsHlsMuxer::segment_close(string log_desc)
728 // valid, add to segments if segment duration is ok 728 // valid, add to segments if segment duration is ok
729 // when too small, it maybe not enough data to play. 729 // when too small, it maybe not enough data to play.
730 // when too large, it maybe timestamp corrupt. 730 // when too large, it maybe timestamp corrupt.
731 - if (current->duration * 1000 >= SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS && (int)current->duration <= max_td) { 731 + // make the segment more acceptable, when in [min, max_td * 2], it's ok.
  732 + if (current->duration * 1000 >= SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS && (int)current->duration <= max_td * 2) {
732 segments.push_back(current); 733 segments.push_back(current);
733 734
734 // use async to call the http hooks, for it will cause thread switch. 735 // use async to call the http hooks, for it will cause thread switch.