hls/http-ts播放器新增性能测试模式

This commit is contained in:
ziyue
2022-02-11 11:04:16 +08:00
parent 91c0a563c3
commit 8338773767
4 changed files with 28 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ TsPlayer::TsPlayer(const EventPoller::Ptr &poller) : HttpTSPlayer(poller, true)
void TsPlayer::play(const string &url) {
TraceL << "play http-ts: " << url;
_play_result = false;
_benchmark_mode = (*this)[Client::kBenchmarkMode].as<int>();
setHeaderTimeout((*this)[Client::kTimeoutMS].as<int>());
setBodyTimeout((*this)[Client::kMediaTimeoutMS].as<int>());
setMethod("GET");
@@ -45,7 +46,9 @@ void TsPlayer::onResponseBody(const char *buf, size_t size) {
_play_result = true;
onPlayResult(SockException(Err_success, "play http-ts success"));
}
HttpTSPlayer::onResponseBody(buf, size);
if (!_benchmark_mode) {
HttpTSPlayer::onResponseBody(buf, size);
}
}
} // namespace mediakit