winlin

always increasing target duration, for #304

@@ -204,7 +204,11 @@ int SrsHlsMuxer::update_config(SrsRequest* r, string path, int fragment, int win @@ -204,7 +204,11 @@ int SrsHlsMuxer::update_config(SrsRequest* r, string path, int fragment, int win
204 hls_path = path; 204 hls_path = path;
205 hls_fragment = fragment; 205 hls_fragment = fragment;
206 hls_window = window; 206 hls_window = window;
207 - target_duration = (int)(fragment * _srs_config->get_hls_td_ratio(r->vhost)); 207 +
  208 + // we always keep the target duration increasing.
  209 + int max_td = srs_max(target_duration, (int)(fragment * _srs_config->get_hls_td_ratio(r->vhost)));
  210 + srs_info("hls update target duration %d=>%d", target_duration, max_td);
  211 + target_duration = max_td;
208 212
209 std::string storage = _srs_config->get_hls_storage(r->vhost); 213 std::string storage = _srs_config->get_hls_storage(r->vhost);
210 if (storage == "ram") { 214 if (storage == "ram") {