From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7FE95409B9 for ; Wed, 23 Mar 2022 20:27:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CEAA768B151; Wed, 23 Mar 2022 22:27:04 +0200 (EET) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.219]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF5F968A2C4 for ; Wed, 23 Mar 2022 22:26:57 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1648067217; s=strato-dkim-0002; d=oneric.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=A/ov6n0Svk1BbssXA2dMKmeX4o3wcva7qR7xZ0aT084=; b=MiAcNye3elT9Md2Kjt3nurYMWxm8xKc5Y2m10RmnTHVdnySdf7DbO2H81+vUnDlc06 t6uBb/X66PE5gLAYtjtIYf7qdRYz4dD7f9Rv8B/ubrZqhRQvtuLSeJhP4QFZZk6ux4/z xz6x3FRFML8AhZ2Cki2aNPgzr/mbZNjV4+L0JUI0HAZq8NF6vsuceBtrKBvoL4hGok/w B/ipB+IVbNKOnnFisn5IhriEb/jb/5uXEYjPa8Ent6ZSp04GQcI95Y0Uqw/ETL7keBME +GSp87IjJLGvtrePLnI7II1e6hYpWXybOWObNZWDEj4pVtR96xhh2KFpAKUFQW1KXZks Ho7w== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":I2IBZ0mrW/AWQXwgB4oxKM1YsW1lFUznrLvi/XReWqAAlWwZ8wlvfXmGs4jUQ0oz8ZbhHexs8fhgU3cBLt8h6HoCFVKRvhH/lIQ+T2U=" X-RZG-CLASS-ID: mo00 Received: from oneric.de by smtp.strato.de (RZmta 47.41.1 AUTH) with ESMTPSA id 341117y2NKQubkx (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Wed, 23 Mar 2022 21:26:56 +0100 (CET) Date: Wed, 23 Mar 2022 21:26:56 +0100 From: Oneric To: FFmpeg development discussions and patches Message-ID: References: <20220314190638.24816-1-oneric@oneric.de> <147fd7d8-a587-dca3-cef1-62a75fcd293b@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9hg/AJnCzfDLZ7M3" Content-Disposition: inline In-Reply-To: <147fd7d8-a587-dca3-cef1-62a75fcd293b@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_subtitles: pass storage size to libass X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --9hg/AJnCzfDLZ7M3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --9hg/AJnCzfDLZ7M3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-avfilter-vf_subtitles-pass-storage-size-to-libass.patch" >From 27b6deafe859eb9bddfb21498a11f2b2b613802b Mon Sep 17 00:00:00 2001 From: Oneric 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 --9hg/AJnCzfDLZ7M3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --9hg/AJnCzfDLZ7M3--