From: Oneric <oneric@oneric.de> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: pass storage size to libass Date: Wed, 23 Mar 2022 21:26:56 +0100 Message-ID: <YjuCkPxmYwZ0VS1R@oneric.de> (raw) In-Reply-To: <147fd7d8-a587-dca3-cef1-62a75fcd293b@gmail.com> [-- Attachment #1: Type: text/plain, Size: 527 bytes --] On Tue, Mar 22, 2022 at 13:45:20 -0300, James Almer wrote: > > Will apply it unless someone is against it. Thanks for applying the patch! In case this fix is eligible for backporting: It applies nicely at is to the release/5.0 branch and 5.0 also already requires a new enough libass for ass_set_storage_size to be always available. For the release/4.[0-4] branches, the attached patch can be used instead. It applied without problems for me on all the 4.x branches and also built and passed FATE with the config I used. [-- Attachment #2: 0001-avfilter-vf_subtitles-pass-storage-size-to-libass.patch --] [-- Type: text/x-diff, Size: 1384 bytes --] From 27b6deafe859eb9bddfb21498a11f2b2b613802b Mon Sep 17 00:00:00 2001 From: Oneric <oneric@oneric.de> Date: Wed, 23 Mar 2022 20:43:54 +0100 Subject: [PATCH] avfilter/vf_subtitles: pass storage size to libass Due to a quirk of the ASS format some tags depend on the exact storage resolution of the video, so tell libass via ass_set_storage_size. --- libavfilter/vf_subtitles.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index de74afa2b7..b57dd80b13 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -145,9 +145,16 @@ static int config_input(AVFilterLink *inlink) ff_draw_init(&ass->draw, inlink->format, ass->alpha ? FF_DRAW_PROCESS_ALPHA : 0); ass_set_frame_size (ass->renderer, inlink->w, inlink->h); - if (ass->original_w && ass->original_h) + if (ass->original_w && ass->original_h) { ass_set_aspect_ratio(ass->renderer, (double)inlink->w / inlink->h, (double)ass->original_w / ass->original_h); +#if LIBASS_VERSION > 0x01010000 + ass_set_storage_size(ass->renderer, ass->original_w, ass->original_h); + } else { + ass_set_storage_size(ass->renderer, inlink->w, inlink->h); +#endif + } + if (ass->shaping != -1) ass_set_shaper(ass->renderer, ass->shaping); -- 2.30.2 [-- Attachment #3: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2022-03-23 20:27 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-14 19:06 Oneric 2022-03-14 19:35 ` Soft Works 2022-03-14 19:49 ` Oneric 2022-03-14 19:57 ` Soft Works 2022-03-14 20:07 ` Oneric 2022-03-14 20:21 ` Soft Works 2022-03-22 16:27 ` Oneric 2022-03-22 16:42 ` Soft Works 2022-03-22 16:45 ` James Almer 2022-03-23 20:26 ` Oneric [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YjuCkPxmYwZ0VS1R@oneric.de \ --to=oneric@oneric.de \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git