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

オープン 初心者向け
#2,465 コメント 2 件 リアクション 0 件 担当者 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 ブロックが無効な ## トークンで終わり、次に 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時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CCExtractor/ccextractor のほかの issue

CCExtractor/ccextractor の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。