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 8327249E3F for ; Tue, 12 Mar 2024 13:49:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9758968D011; Tue, 12 Mar 2024 15:49:51 +0200 (EET) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AF5AF68CCF8 for ; Tue, 12 Mar 2024 15:49:45 +0200 (EET) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a462a1b7754so269388766b.2 for ; Tue, 12 Mar 2024 06:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710251384; x=1710856184; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=6asrKnKShZw21AyfaLhmXkTmJlg8GKyoGdzvpi2GRJM=; b=hba0xciAaCECSCUDmaCm4JKkhJVba+FopKK/C50fapeXt0enMxpfKqUJPRypKRi0Pc 5V/0pQwXbC/IndwVzY8bQqnVArq9mv51UGk12dLntGb9GgqJj8Gc8e4HHVGKuGY9Z4vU 9LtZIqZ41rCsKsjekHytDZxno+eUoKH916RuTsJ7IG+MK0eO2vzOkXAkWgNIkgTubjW3 aDjzcsMxSbSdH268mIgZpLubsIJIoSlmT6l6H0ySVJGhzKHNoVXpJBo67jHhhvyar3wq 6TNiJ3bL26w3C5PF6oZkS89xoAfhc/04PiOyeUHQN4pYuLCLkFZgoiAFqDHYJZ+uBhUy NUDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710251384; x=1710856184; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6asrKnKShZw21AyfaLhmXkTmJlg8GKyoGdzvpi2GRJM=; b=arkuhMAB5UNVYTmk781UV9DzwDt5S2jr7g60dOAx65AbVK2PmDyJqvtP0Mdgu6t7l7 vvHIkukZcZ0bN95Y12Lp6ASM5v/61PNewxZebz0POQlj9+YM2mJ8W9Fn3iO1fb6tM6lM CRJvFLhmPjOUTYsIiVqG1REl06NQ8XeUgOwgldid/QpmGdkxIA/kWwePnSF5BOLtjp1p uKCxlB5htCSIQjVlcsnhay9YZye6VRzPgVf/pQ7qmDydl9xPJQyr2/weB8T30O2igsYS nl1PMpz37azt9MgSHEvilVupHjspZVtR5a5jr1wT0bklGqP8KnalZhtze+sySPaTu4rF z6sA== X-Gm-Message-State: AOJu0YwvfRDygJlCZf5Cyva3UdD/F/7MtQDRZeCZ9BgBvB72Oos6CkFE I1HCSfyrP46iwJXcJjPhLmRbGo22XeUwk31JfU/LlQUHkWmY7T1PDGMUWUAG X-Google-Smtp-Source: AGHT+IHDZA7pOnDC3WR9eYmL58HuON+TYQKKcQuTQ16IcsiLQSGuOs5njbYLlm1feNzS1QUo6RJFew== X-Received: by 2002:a17:906:6897:b0:a45:a2cc:eb8b with SMTP id n23-20020a170906689700b00a45a2cceb8bmr5897940ejr.13.1710251383817; Tue, 12 Mar 2024 06:49:43 -0700 (PDT) Received: from mariano ([188.210.239.79]) by smtp.gmail.com with ESMTPSA id lk16-20020a170906cb1000b00a45bda3cbb8sm3853962ejb.134.2024.03.12.06.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 06:49:43 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id C6B64BFCDC; Tue, 12 Mar 2024 14:49:41 +0100 (CET) Date: Tue, 12 Mar 2024 14:49:41 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Marth64 References: <20240312060005.2111135-1-marth64@proxyid.net> <20240312060005.2111135-3-marth64@proxyid.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240312060005.2111135-3-marth64@proxyid.net> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH v3 2/6] avcodec/ccaption_dec: don't print multiple \an and \pos tags 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 Cc: Marth64 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Tuesday 2024-03-12 01:00:01 -0500, Marth64 wrote: > Closed Captions decoder prints multiple \pos ASS tags per cue, > and preceding the \pos tag is a fixed \an7 that fixes rendering > position from the top left corner and enforces justification. > > Printing multiple \an and \pos tags in this way is invalid behavior, > because only the first \pos tag in a cue is honored by ASS anyway. > Don't write multiple \an and \pos tags. > > Also, update tests accordingly. > > Signed-off-by: Marth64 > --- > libavcodec/ccaption_dec.c | 8 +- > tests/ref/fate/sub-cc | 2 +- > tests/ref/fate/sub-cc-realtime | 8 +- > tests/ref/fate/sub-cc-scte20 | 4 +- > tests/ref/fate/sub-scc | 146 ++++++++++++++++----------------- > 5 files changed, 86 insertions(+), 82 deletions(-) > > diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c > index faf058ce97..9d4a93647c 100644 > --- a/libavcodec/ccaption_dec.c > +++ b/libavcodec/ccaption_dec.c > @@ -456,7 +456,7 @@ static void roll_up(CCaptionSubContext *ctx) > > static int capture_screen(CCaptionSubContext *ctx) > { > - int i, j, tab = 0; > + int i, j, tab = 0, seen_row = 0; > struct Screen *screen = ctx->screen + ctx->active_screen; > enum cc_font prev_font = CCFONT_REGULAR; > enum cc_color_code prev_color = CCCOL_WHITE; > @@ -496,7 +496,11 @@ static int capture_screen(CCaptionSubContext *ctx) > > x = ASS_DEFAULT_PLAYRESX * (0.1 + 0.0250 * j); > y = ASS_DEFAULT_PLAYRESY * (0.1 + 0.0533 * i); > - av_bprintf(&ctx->buffer[bidx], "{\\an7}{\\pos(%d,%d)}", x, y); > + > + if (!seen_row) { > + av_bprintf(&ctx->buffer[bidx], "{\\an7}{\\pos(%d,%d)}", x, y); > + seen_row = 1; > + } probably it might be useful to print debug logs in case the pos coordinates are found but not rendered? [...] LGTM otherwise. _______________________________________________ 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".