feat(ncm §24): 流媒体客户端边下边播阶段3——.part断点续传(Range/206/200/416)+LRU防淘汰(.tmp/.part跳过)+失败重试1次退避
按 devdocs/plan/NCM_STREAM_PLAY.md §8 阶段3: - .part 断续传:中断留 .part,续传带 Range,206 追加 / 200 丢头段 / 416 删残留整首重下;URL 每次新拉 - LRU 防淘汰:evict/total_bytes 跳过 .tmp/.part(在播文件不被动过) - 失败重试:预缓冲前网络失败重试 1 次,退避 800ms,重试拿新签名 URL(风控:0 真实请求,未部署) - 顺手修:gb_to_bytes 返回 int 溢出致默认 10GB 上限失效 -> uint64_t - 验证:stream_sim(续传 PCM 金标准+全矩阵)/player_flow_sim(P9/P10/P11)/cache_evict_sim(case7/8)/test_ncm_core 宿主+qemu-mipsel 全 PASS;build_ncm.sh 0 warning;ncm_host 离屏正常 md5 ncm f8f316a1e6f3bdd8f6b5921fdbb3f3a2
This commit is contained in:
1 parent
fcff0b0ac1
commit
19e8fc93ed
14 files changed
+735
-93
No files matched your search
@@ -64,6 +64,16 @@ int stream_src_open_stream(stream_src_t **out, const char *tmp_path)
|
||||
return src_alloc(out, fd); /* written=0/final=0:下载中 */
|
||||
}
|
||||
|
||||
int stream_src_open_stream_at(stream_src_t **out, const char *path, uint64_t written)
|
||||
{
|
||||
if (!out || !path) return -1;
|
||||
int fd = open(path, O_RDONLY);
|
||||
if (fd < 0) return -1;
|
||||
int rc = src_alloc(out, fd);
|
||||
if (rc == 0) (*out)->written = written; /* 续传(§5.2):前缀已落盘,读端 read_pos=0 可即读 */
|
||||
return rc;
|
||||
}
|
||||
|
||||
int stream_src_open_static(stream_src_t **out, const char *path, uint64_t size)
|
||||
{
|
||||
if (!out || !path) return -1;
|
||||
|
||||
Reference in new issue
Block a user