[FFmpeg-devel] [PATCH] avformat/assenc: Don't truncate lines to 4095 characters
Tellow Krinkle
tellowkrinkle at gmail.com
Sun Aug 4 07:32:31 EEST 2019
Fixes #6390
Sample file for new test: https://gist.githubusercontent.com/tellowkrinkle/d6a6e328f892dbbacc000ad9c3890644/raw/4f68e56b1f0fab594aae040723722af4f5161a02/longline.ass
Signed-off-by: Tellow Krinkle <tellowkrinkle at gmail.com>
---
libavformat/assenc.c | 4 +++-
tests/fate/subtitles.mak | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavformat/assenc.c b/libavformat/assenc.c
index d50f18feb1..9b44b16597 100644
--- a/libavformat/assenc.c
+++ b/libavformat/assenc.c
@@ -95,7 +95,9 @@ static void purge_dialogues(AVFormatContext *s, int force)
ass->expected_readorder, dialogue->readorder);
ass->expected_readorder = dialogue->readorder;
}
- avio_printf(s->pb, "Dialogue: %s\r\n", dialogue->line);
+ avio_write(s->pb, "Dialogue: ", 10);
+ avio_write(s->pb, dialogue->line, strlen(dialogue->line));
+ avio_write(s->pb, "\r\n", 2);
if (dialogue == ass->last_added_dialogue)
ass->last_added_dialogue = next;
av_freep(&dialogue->line);
diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 0042902161..a4e0fc7432 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -13,6 +13,10 @@ fate-sub-cc-scte20: CMD = fmtstdout ass -f lavfi -i "movie=$(TARGET_SAMPLES)/sub
FATE_SUBTITLES_ASS-$(call DEMDEC, ASS, ASS) += fate-sub-ass-to-ass-transcode
fate-sub-ass-to-ass-transcode: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/1ededcbd7b.ass
+FATE_SUBTITLES_ASS-$(call DEMDEC, ASS, ASS) += fate-sub-ass-long-line
+fate-sub-ass-long-line: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/longline.ass
+fate-sub-ass-long-line: REF = $(TARGET_SAMPLES)/sub/longline.ass
+
FATE_SUBTITLES_ASS-$(CONFIG_ASS_DEMUXER) += fate-sub-ssa-to-ass-remux
fate-sub-ssa-to-ass-remux: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/a9-misc.ssa -c copy
--
2.20.1 (Apple Git-117)
More information about the ffmpeg-devel
mailing list