[FFmpeg-devel] [PATCH v4 4/4] avocdec/ass: simplify linebreaks

Oneric oneric at oneric.de
Mon Feb 19 23:42:27 EET 2024


ff_ass_subtitle_header_* still used explicit CRLF linebreaks
eventhough they will get normalised to LF later since commit
7bf1b9b35769b37684dd2f18a54f01d852a540c8. Just directly use LF.
---
 libavcodec/ass.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index e7a1ac0eb5..927b801404 100644
--- a/libavcodec/ass.c
+++ b/libavcodec/ass.c
@@ -35,15 +35,15 @@ int ff_ass_subtitle_header_full(AVCodecContext *avctx,
                                 int border_style, int alignment)
 {
     avctx->subtitle_header = av_asprintf(
-             "[Script Info]\r\n"
-             "; Script generated by FFmpeg/Lavc%s\r\n"
-             "ScriptType: v4.00+\r\n"
-             "PlayResX: %d\r\n"
-             "PlayResY: %d\r\n"
-             "ScaledBorderAndShadow: yes\r\n"
-             "YCbCr Matrix: None\r\n"
-             "\r\n"
-             "[V4+ Styles]\r\n"
+             "[Script Info]\n"
+             "; Script generated by FFmpeg/Lavc%s\n"
+             "ScriptType: v4.00+\n"
+             "PlayResX: %d\n"
+             "PlayResY: %d\n"
+             "ScaledBorderAndShadow: yes\n"
+             "YCbCr Matrix: None\n"
+             "\n"
+             "[V4+ Styles]\n"
 
              /* ASS (v4+) header */
              "Format: Name, "
@@ -54,7 +54,7 @@ int ff_ass_subtitle_header_full(AVCodecContext *avctx,
              "Spacing, Angle, "
              "BorderStyle, Outline, Shadow, "
              "Alignment, MarginL, MarginR, MarginV, "
-             "Encoding\r\n"
+             "Encoding\n"
 
              "Style: "
              "Default,"             /* Name */
@@ -65,11 +65,11 @@ int ff_ass_subtitle_header_full(AVCodecContext *avctx,
              "0,0,"                 /* Spacing, Angle */
              "%d,1,0,"              /* BorderStyle, Outline, Shadow */
              "%d,10,10,10,"         /* Alignment, Margin[LRV] */
-             "1\r\n"                /* Encoding */
+             "1\n"                  /* Encoding */
 
-             "\r\n"
-             "[Events]\r\n"
-             "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
+             "\n"
+             "[Events]\n"
+             "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n",
              !(avctx->flags & AV_CODEC_FLAG_BITEXACT) ? AV_STRINGIFY(LIBAVCODEC_VERSION) : "",
              play_res_x, play_res_y, font, font_size,
              primary_color, secondary_color, outline_color, back_color,
-- 
2.39.2



More information about the ffmpeg-devel mailing list