mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 09:47:33 +08:00
hls拉流动态计算切片超时时间 (#1477)
* 动态计算切片超时时间 设置最大超时时间倍数和最小倍数,然后根据上一个切片的下载情况动态增加或者减少切片的超时时间. * Update HlsPlayer.cpp
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#include "HlsParser.h"
|
||||
#include "Rtp/TSDecoder.h"
|
||||
|
||||
#define MIN_TIMEOUT_MULTIPLE 2
|
||||
#define MAX_TIMEOUT_MULTIPLE 5
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
class HlsDemuxer : public MediaSinkInterface , public TrackSource, public std::enable_shared_from_this<HlsDemuxer> {
|
||||
@@ -101,6 +104,7 @@ private:
|
||||
std::list<std::string> _ts_url_sort;
|
||||
std::set<std::string, UrlComp> _ts_url_cache;
|
||||
HttpTSPlayer::Ptr _http_ts_player;
|
||||
int _timeout_multiple = MIN_TIMEOUT_MULTIPLE;
|
||||
};
|
||||
|
||||
class HlsPlayerImp : public PlayerImp<HlsPlayer, PlayerBase>, private TrackListener {
|
||||
|
||||
Reference in New Issue
Block a user