1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/srtenc: don't produce SRT files with mixed line endings

Initially, avcodec/srtenc.c was outputting CRLF [1]. Later, a real SRT
muxer was added [2], which outputs LF. The original srtenc.c was
converted to use the muxer [3], changing its output to LF, except for
newline characters within subtitle text.

Fix this to avoid producing SRT files with mixed line endings.

[1] 8e43b6fed9
[2] 9e63c30daa
[3] 55180b3299

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2025-08-01 23:49:50 +02:00
parent 5bd7003e81
commit 5c95e8e3a6
4 changed files with 71 additions and 71 deletions

View File

@ -145,7 +145,7 @@ static void srt_text_cb(void *priv, const char *text, int len)
static void srt_new_line_cb(void *priv, int forced) static void srt_new_line_cb(void *priv, int forced)
{ {
srt_print(priv, "\r\n"); srt_print(priv, "\n");
} }
static void srt_style_cb(void *priv, char style, int close) static void srt_style_cb(void *priv, char style, int close)