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 18E2D421A5 for ; Thu, 24 Feb 2022 21:12:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1385A68B354; Thu, 24 Feb 2022 23:12:23 +0200 (EET) Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DC7068A8A5; Thu, 24 Feb 2022 23:12:11 +0200 (EET) Received: by mail-vk1-f182.google.com with SMTP id j201so557028vke.11; Thu, 24 Feb 2022 13:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VyOl/+bdCX0sc2DDce/+BoGsh07aCl5kqvvaBJxp1sM=; b=OSASdwHXMP171nbaj7UPPPtznnfBZ2GZ9D3zCvIyMytHVCXYCIMWB7RanH/X1sBNsB 00+Co3aC/TxhyJEwAVVNJw+1gk+fmtdiRHE/KGSym4TE4ReD8Dw+MHy8TltQuGAseTLW U/ZvQ5NXgDgR3H4EQ3QlHKQVhbZYFudL3hmA010sQ4mkrtU3P8zSVC76FOSP9P2bs/5O Pmd9rcpMgJNiKyg0SdGPHYsM2SFCAinTBD1CGRKafp0l0kLJisPXUBnEH8yCvg2Nxo+/ VFfy+wx+c7R5FtocXyp2y6FGtF3pjW1o0sRYdROmnuJHnHO55prUi/nztJoRmqilDX2h 6DeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VyOl/+bdCX0sc2DDce/+BoGsh07aCl5kqvvaBJxp1sM=; b=ThNxdbwoFJtG9ErxvahomCopDOCTlBV7+nORyCCITGtjug/lYICshRwqkF1IHsRoML lJcwMoA6soBQ1Bait76XPn3cchGOKPh1og5EqeiR40zUAuATUlt2uF1Q2Jj+FBxqM0Ek EAxvn/DkUDjOpJi64ZazejQ4MkVAwIslVKbQw8nO2pfJTSkFMtJUvaaSOidVtPB4JQOk nc8TCwOFZqVywCnxAi55ndeFk6AMu/+BwrgIfKbUP4+rQ93hCZaBvZ8wCDbSIoGbmq7X W/JAfiFHuDn1UGKR5A4cHVitSvBeAamXBCqHoy5Xl6nyt6Q2GfW7GMw3Ylo1VGKm2nkl S9jQ== X-Gm-Message-State: AOAM532CV/T4Ulp5AXuQmP8+wKu55LhnjnuKtyJsdKnuHsA7cUFX0v1+ /R0FFwPfgren9y67CgZipJ9o835qTo4MDk80FWEx44vY8VU= X-Google-Smtp-Source: ABdhPJzCZhRxN6p1nkgLz+H6zS1UGJapWMKLEnCC6v452fI2jCb8Yr7akSjcjDOb/ff8SxEKXjVRd10pmXUw6NizUYA= X-Received: by 2002:a05:6122:1898:b0:32d:5227:d967 with SMTP id bi24-20020a056122189800b0032d5227d967mr2152085vkb.38.1645737129585; Thu, 24 Feb 2022 13:12:09 -0800 (PST) MIME-Version: 1.0 References: <20220224203039.CD4BB41059B@natalya.videolan.org> In-Reply-To: <20220224203039.CD4BB41059B@natalya.videolan.org> From: Thierry Foucu Date: Thu, 24 Feb 2022 13:11:32 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vf_tpad: if there is no frame to clone return early 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: FFmpeg git commit log and discussion 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 Thu, Feb 24, 2022 at 12:30 PM Paul B Mahol wrote: > ffmpeg | branch: master | Paul B Mahol | Thu Feb 24 > 20:32:41 2022 +0100| [3715f2f8643695940582ce040b7a052cccfb9db2] | > committer: Paul B Mahol > > avfilter/vf_tpad: if there is no frame to clone return early > > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3715f2f8643695940582ce040b7a052cccfb9db2 > --- > > libavfilter/vf_tpad.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c > index e5acece1e4..120dbcb4d3 100644 > --- a/libavfilter/vf_tpad.c > +++ b/libavfilter/vf_tpad.c > @@ -148,6 +148,11 @@ static int activate(AVFilterContext *ctx) > frame->data, frame->linesize, > 0, 0, frame->width, frame->height); > } else if (s->stop_mode == 1) { > + if (!s->cache_stop) { > + s->pad_stop = 0; > + ff_outlink_set_status(outlink, AVERROR_EOF, s->pts); > + return 0; > + } > frame = av_frame_clone(s->cache_stop); > if (!frame) > return AVERROR(ENOMEM); > > The problem with this solution is that the tpad will then not do what we are expecting, which is padding video track, and the output file will not have the desired duration. Will it not be better to just output black frame (aka stop_mode == 0) , something like that? iff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c index e5acece1e4..5e4062e9f2 100644 --- a/libavfilter/vf_tpad.c +++ b/libavfilter/vf_tpad.c @@ -140,7 +140,7 @@ static int activate(AVFilterContext *ctx) ff_outlink_set_status(outlink, AVERROR_EOF, s->pts); return 0; } - if (s->stop_mode == 0) { + if (s->stop_mode == 0 || !s->cache_stop) { frame = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!frame) return AVERROR(ENOMEM); > _______________________________________________ > ffmpeg-cvslog mailing list > ffmpeg-cvslog@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog > > To unsubscribe, visit link above, or email > ffmpeg-cvslog-request@ffmpeg.org with subject "unsubscribe". > -- Thierry Foucu _______________________________________________ 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".