mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-01 15:32:23 +08:00
hls拉流时应该适当重试 (#1541)
* hls拉流时应该适当重试 hls拉取索引文件失败时, 不应该直接上报,而应该内部适当重试几次. 避免由于网络抖动造成的客户端播放不流畅. * Update HlsPlayer.cpp
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#define MIN_TIMEOUT_MULTIPLE 2
|
||||
#define MAX_TIMEOUT_MULTIPLE 5
|
||||
#define MAX_TRY_FETCH_INDEX_TIMES 5
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
@@ -105,6 +106,7 @@ private:
|
||||
std::set<std::string, UrlComp> _ts_url_cache;
|
||||
HttpTSPlayer::Ptr _http_ts_player;
|
||||
int _timeout_multiple = MIN_TIMEOUT_MULTIPLE;
|
||||
int _try_fetch_index_times = 0;
|
||||
};
|
||||
|
||||
class HlsPlayerImp : public PlayerImp<HlsPlayer, PlayerBase>, private TrackListener {
|
||||
|
||||
Reference in New Issue
Block a user