[FFmpeg-devel] [PATCH v2 2/3] avcodec/libaribcaption: change new lines to \n in ASS header

Kacper Michajłow kasper93 at gmail.com
Fri May 10 23:30:02 EEST 2024


Fixes remaining \r\n is ASS header after 57c545090d.

Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
---
 libavcodec/libaribcaption.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 0b67d41772..46a2a591c5 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -522,14 +522,14 @@ static int set_ass_header(ARIBCaptionContext *ctx)
 
     av_freep(&avctx->subtitle_header);
     avctx->subtitle_header = av_asprintf(
-            "[Script Info]\r\n"
-            "ScriptType: v4.00+\r\n"
-            "PlayResX: %d\r\n"
-            "PlayResY: %d\r\n"
-            "WrapStyle: 2\r\n"      /* 2: no word wrapping */
-            "\r\n"
-
-            "[V4+ Styles]\r\n"
+            "[Script Info]\n"
+            "ScriptType: v4.00+\n"
+            "PlayResX: %d\n"
+            "PlayResY: %d\n"
+            "WrapStyle: 2\n"        /* 2: no word wrapping */
+            "\n"
+
+            "[V4+ Styles]\n"
              "Format: Name, "
              "Fontname, Fontsize, "
              "PrimaryColour, SecondaryColour, OutlineColour, BackColour, "
@@ -538,7 +538,7 @@ static int set_ass_header(ARIBCaptionContext *ctx)
              "Spacing, Angle, "
              "BorderStyle, Outline, Shadow, "
              "Alignment, MarginL, MarginR, MarginV, "
-             "Encoding\r\n"
+             "Encoding\n"
 
              "Style: "
              "Default,"             /* Name */
@@ -549,11 +549,11 @@ static int set_ass_header(ARIBCaptionContext *ctx)
              "0,0,"                 /* Spacing, Angle */
              "%d,%d,%d,"            /* BorderStyle, Outline, Shadow */
              "%d,10,10,10,"         /* Alignment, Margin[LRV] */
-             "0\r\n"                /* Encoding */
-             "\r\n"
+             "0\n"                  /* Encoding */
+             "\n"
 
-             "[Events]\r\n"
-             "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
+             "[Events]\n"
+             "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n",
             ctx->plane_width, ctx->plane_height,
             font_name, ctx->font_size,
             ASS_DEFAULT_COLOR, ASS_DEFAULT_COLOR,
-- 
2.43.0



More information about the ffmpeg-devel mailing list