mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
test: add subparse test for SRT subtitles with no newline at the end
Add a test to verify that SRT subtitles work even if the last chunk does not have an empty line after it.
This commit is contained in:
parent
1c454fdafc
commit
f8bed33d4b
1 changed files with 11 additions and 0 deletions
|
@ -194,6 +194,14 @@ static SubParseInputChunk srt_input5[] = {
|
||||||
,
|
,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Test with no newline at the end */
|
||||||
|
static SubParseInputChunk srt_input6[] = {
|
||||||
|
{
|
||||||
|
"1\n00:00:01,000 --> 00:00:02,000\nLast cue, no newline at the end",
|
||||||
|
1 * GST_SECOND, 2 * GST_SECOND, "Last cue, no newline at the end"}
|
||||||
|
,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_subparse (void)
|
setup_subparse (void)
|
||||||
|
@ -390,6 +398,9 @@ GST_START_TEST (test_srt)
|
||||||
|
|
||||||
/* try with some broken/cut-off timestamp */
|
/* try with some broken/cut-off timestamp */
|
||||||
test_srt_do_test (srt_input5, 0, G_N_ELEMENTS (srt_input5));
|
test_srt_do_test (srt_input5, 0, G_N_ELEMENTS (srt_input5));
|
||||||
|
|
||||||
|
/* try without an empty line at the end */
|
||||||
|
test_srt_do_test (srt_input6, 0, G_N_ELEMENTS (srt_input6));
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
Loading…
Reference in a new issue