[vlc-commits] [Git][videolan/vlc][master] demux: subtitle: accept tabs around srt arrows
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Sep 17 03:30:38 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
39ae7f63 by Alaric Senat at 2026-09-17T05:17:16+02:00
demux: subtitle: accept tabs around srt arrows
The SRT demux probe accepts arbitrary whitespace around the arrow, but
the timing parser only looks for an arrow surrounded by literal spaces.
As a result, tab-separated cues are detected as SubRip and then discarded.
This is a regression from c76b8a42d216382b12e2de5d9cfd4d34a04a7431.
Match the arrow itself and let the timestamp parser consume surrounding
whitespace. This now also accepts arrows without surrounding whitespace, which
is already accepted by the demux probe anyway.
Fixes #30130
- - - - -
1 changed file:
- modules/demux/subtitle.c
Changes:
=====================================
modules/demux/subtitle.c
=====================================
@@ -1178,7 +1178,7 @@ success:
static int subtitle_ParseSubRipTiming( subtitle_t *p_subtitle,
const char *s )
{
- const char *delimiter = strstr(s, " --> ");
+ const char *delimiter = strstr(s, "-->");
if (delimiter == NULL || delimiter == s)
return VLC_EGENERIC;
@@ -1186,7 +1186,7 @@ static int subtitle_ParseSubRipTiming( subtitle_t *p_subtitle,
if (ret != VLC_SUCCESS)
return ret;
- const char *right = delimiter + strlen(" --> ");
+ const char *right = delimiter + strlen("-->");
return subtitle_ParseSubRipTimingValue(&p_subtitle->i_stop, right, strlen(right));
}
@@ -2660,6 +2660,7 @@ static void test_subtitle_ParseSubRipTiming(void)
{ "0:0:0,0 --> 0:0:0,0", VLC_TICK_0, VLC_TICK_0 },
{ "0:0:0.0 --> 0:0:0.0", VLC_TICK_0, VLC_TICK_0 },
{ "0:0:0 --> 0:0:0", VLC_TICK_0, VLC_TICK_0 },
+ { "0:0:0.0\t-->\t0:0:0", VLC_TICK_0, VLC_TICK_0 },
};
static const char *timing_values_fail[] =
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/39ae7f63fb2f3d8d4d4cb0e4ae314015e5ac636c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/39ae7f63fb2f3d8d4d4cb0e4ae314015e5ac636c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list