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 9876D46737 for ; Fri, 16 Jun 2023 09:32:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D273068C5FE; Fri, 16 Jun 2023 12:30:38 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1198268C5C1 for ; Fri, 16 Jun 2023 12:30:26 +0300 (EEST) Received: from localhost (217-74-0-168.hsi.r-kom.net [217.74.0.168]) by haasn.dev (Postfix) with ESMTPSA id EF537436F9; Fri, 16 Jun 2023 11:30:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1686907824; bh=xHp5X9Z6xRxUqeUMMO+b0XnKEq9TfTtVJiLuG1mgIUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FE5o4xlzAAdAbRP2YRELGuGAuL/nQPsWpf0PKEt3T4aJFlO2Y4e+pTRmLTsu0ucH/ TDt9NxqjwB5RrlVJuPp+m7N3NhZJNlb0d8KR9COaQYzkeEBsEjDYkCkJEWVI4gU9hh siaLwcea3RHCclgJaLNdXRuEh49b15sI2GmJOkSw= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Jun 2023 11:29:45 +0200 Message-ID: <20230616092959.5247-8-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230616092959.5247-1-ffmpeg@haasn.xyz> References: <20230616092959.5247-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/22] lavfi/vf_libplacebo: use correct link in update_crops() 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: Niklas Haas 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: From: Niklas Haas Instead of hard-coding input 0, pass the per-input structure and use the link contained inside it. --- libavfilter/vf_libplacebo.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index b83df24a84..408fb3918a 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -715,19 +715,18 @@ static const AVFrame *ref_frame(const struct pl_frame_mix *mix) return NULL; } -static void update_crops(AVFilterContext *ctx, - struct pl_frame_mix *mix, struct pl_frame *target, - double target_pts) +static void update_crops(AVFilterContext *ctx, LibplaceboInput *in, + struct pl_frame *target, double target_pts) { LibplaceboContext *s = ctx->priv; - const AVFrame *ref = ref_frame(mix); + const AVFrame *ref = ref_frame(&in->mix); - for (int i = 0; i < mix->num_frames; i++) { + for (int i = 0; i < in->mix.num_frames; i++) { // Mutate the `pl_frame.crop` fields in-place. This is fine because we // own the entire pl_queue, and hence, the pointed-at frames. - struct pl_frame *image = (struct pl_frame *) mix->frames[i]; + struct pl_frame *image = (struct pl_frame *) in->mix.frames[i]; const AVFrame *src = pl_get_mapped_avframe(image); - double image_pts = src->pts * av_q2d(ctx->inputs[0]->time_base); + double image_pts = src->pts * av_q2d(in->link->time_base); /* Update dynamic variables */ s->var_values[VAR_IN_T] = s->var_values[VAR_T] = image_pts; @@ -851,7 +850,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) goto fail; } - update_crops(ctx, &in->mix, &target, out->pts * av_q2d(outlink->time_base)); + update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base)); pl_render_image_mix(in->renderer, &in->mix, &target, &s->params); if (outdesc->flags & AV_PIX_FMT_FLAG_HWACCEL) { -- 2.41.0 _______________________________________________ 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".