diff mbox series

[FFmpeg-devel] avformat/webvttdec: Skip more parts of header to let parsing continue

Message ID 411082922.1517806.1708972592599@mail.yahoo.com
State New
Headers show
Series [FFmpeg-devel] avformat/webvttdec: Skip more parts of header to let parsing continue | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Kristoffer Brånemyr Feb. 26, 2024, 6:36 p.m. UTC
Hi,
Here is a short patch to skip more parts of the header for the WebVTT subtitle format. Without this the parser seems to stop and no subtitles are produced for the user.You can find the WebVTT specification here: WebVTT: The Web Video Text Tracks Format

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
WebVTT: The Web Video Text Tracks Format


 |

 |

 |


I attach an example file using the STYLE header part.
I verified that with this change, I can see the subtitles using mpv.

I tried to run fate, but even without my changes it seems to fail?

-- /Kristoffer Brånemyr

Comments

Kristoffer Brånemyr March 11, 2024, 7:16 p.m. UTC | #1
Den måndag 26 februari 2024 kl. 19:36:58 CET, Kristoffer Brånemyr via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> skrev: 


>Hi,
>Here is a short patch to skip more parts of the header for the WebVTT subtitle format. Without this the parser seems to stop and no subtitles are produced for the user.You can find the WebVTT specification here: WebVTT: The Web Video Text Tracks Format
>>WebVTT: The Web Video Text Tracks Format>
>
 >|
>
 >|
>
 >|
>
>
>I attach an example file using the STYLE header part.
>I verified that with this change, I can see the subtitles using mpv.
>
>I tried to run fate, but even without my changes it seems to fail?
>

Hi again,

Did anyone get a chance to look at this patch? It's a small patch, only adding two lines.

Looks like the URL to the WebVTT specification got broken last time by the webmail I use, I hope this time it will work better:
https://www.w3.org/TR/webvtt1/#file-structure

Thanks!

-- 
/Kristoffer Brånemyr
Marton Balint March 12, 2024, 9:46 p.m. UTC | #2
On Mon, 11 Mar 2024, Kristoffer Brånemyr via ffmpeg-devel wrote:

>
> Den måndag 26 februari 2024 kl. 19:36:58 CET, Kristoffer Brånemyr via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> skrev: 
>
>
>> Hi,
>> Here is a short patch to skip more parts of the header for the WebVTT subtitle format. Without this the parser seems to stop and no subtitles are produced for the user.You can find the WebVTT specification here: WebVTT: The Web Video Text Tracks Format
>>> WebVTT: The Web Video Text Tracks Format>
>>
> >|
>>
> >|
>>
> >|
>>
>>
>> I attach an example file using the STYLE header part.
>> I verified that with this change, I can see the subtitles using mpv.
>>
>> I tried to run fate, but even without my changes it seems to fail?
>>
>
> Hi again,
>
> Did anyone get a chance to look at this patch? It's a small patch, only adding two lines.
>
> Looks like the URL to the WebVTT specification got broken last time by the webmail I use, I hope this time it will work better:
> https://www.w3.org/TR/webvtt1/#file-structure

Will apply.

Thanks,
Marton
diff mbox series

Patch

From 416d9ae6a57887de0641b9b7ef6a353d95ae7e61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Br=C3=A5nemyr?= <ztion1@yahoo.se>
Date: Mon, 26 Feb 2024 18:05:38 +0100
Subject: [PATCH] avformat/webvttdec: Skip more parts of header to let parsing
 continue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Kristoffer Brånemyr <ztion1@yahoo.se>
---
 libavformat/webvttdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index fbe7ce316c..3665c9086b 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -94,6 +94,8 @@  static int webvtt_read_header(AVFormatContext *s)
         /* ignore header chunk */
         if (!strncmp(p, "\xEF\xBB\xBFWEBVTT", 9) ||
             !strncmp(p, "WEBVTT", 6) ||
+            !strncmp(p, "STYLE", 5) ||
+            !strncmp(p, "REGION", 6) ||
             !strncmp(p, "NOTE", 4))
             continue;
 
-- 
2.36.1