修复HTTP-TS 媒体帧超时 (#4793)

这个修复是因为有时的可能由于上游网络flow损坏,会导致http-ts拉流时连接不会断开, 只有几kb的速度.
这样实际上流媒体是无法正常播放的, 但是又因为能读取到非常少的数据, 不会触发超时. 等于链接假死在那里了.常见与跨域/跨洲传输时.
所以这个pr就是用于判断如果媒体帧长时间接收不全, 就也应该认为是超时断开.

后面还会提交一个新的pr, 主要是配合这个pr实现"PlayerProxy 无感重连与 muxer 保留策略", 这样就能在遇到坏flow时,
自动重连, 但是播放器无感知, 也不会断开.
This commit is contained in:
YuLi
2026-08-01 22:09:12 -07:00
committed by GitHub
parent b0427c3901
commit 7768aee571
7 changed files with 76 additions and 12 deletions

View File

@@ -43,6 +43,9 @@ public:
protected:
void onResponseBody(const char *buf, size_t size) override;
void onResponseCompleted(const toolkit::SockException &ex) override;
// 将 HTTP 完成状态转换为播放器最终的 shutdown 状态,确保所有完成回调语义一致。
// Convert the HTTP completion status to the final player shutdown status so all completion callbacks agree.
virtual toolkit::SockException translateShutdownException(const toolkit::SockException &ex) { return ex; }
private:
bool _play_result = true;