[BUG] encoders: WebVTT encoder generates invalid ## delimiter and malformed @import violating W3C specification

未关闭 适合新手
#2,465 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

@yasar710 已经在做这个了。

开始于 2026年11月17日。

  • #2467 来自 @yasar710 —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
c
领域
cli

调研方向

两个缺陷都在 src/lib_ccx/ccx_encoders_webvtt.c 中:从 write_webvtt_header 开始,其中 STYLE 块以无效的 ## token 结尾,然后是大致第 278 行的 @import 调用,它被输出在任何 STYLE 块之外。将块终止符改为普通空行,并在 STYLE 块内将导入输出为 @import url("...");。完成意味着对示例输入运行 --webvtt --webvtt-css-rule=... 会生成 WebVTT 解析器可接受的输出,其中不含 ## 或裸 @import(。

由索引模型根据 Issue 内容生成。

描述

CCExtractor version: 0.94+ (git commit 77daaddb9f61a356e4a7732179212b192f9656b6)

Necessary information

  • Is this a regression (i.e. did it work before)? NO
  • What platform did you use? Linux (Ubuntu 24.04 LTS x86_64)
  • What were the used arguments? --webvtt --webvtt-css-rule="..." input.ts

Additional information

In src/lib_ccx/ccx_encoders_webvtt.c, write_webvtt_header outputs inline CSS styles when --webvtt-css-rule is provided:

if (context->webvtt_css_rule)
{
    fdprintf(context->out->fh, "STYLE\n\n::cue {\n%s\n}\n##\n\n", context->webvtt_css_rule);
}

Under Section 4.3 of the W3C WebVTT specification, blocks (such as STYLE or NOTE) must terminate and separate from subsequent blocks or cues with a blank line (\n\n). Emitting ##\n\n injects an invalid token into the WebVTT stream. In browser video players (Chromium, Firefox), this token is treated as an invalid cue identifier or malformed block, causing parsers to reject the styling block or fail cue playback.

Additionally, at line 278:

fdprintf(context->out->fh, "@import(%s);\n\n", context->sentence_cap_file);

External stylesheets are written directly into the file body without being enclosed inside a STYLE block and without valid CSS @import url("...") syntax.

主要语言
C
星标
919
派生
604
平均合并
13 天 12 小时
30 天内合并 PR
7

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CCExtractor/ccextractor 的其他 Issue

查看 CCExtractor/ccextractor 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。