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 37F22421B6 for ; Thu, 24 Feb 2022 21:28:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4CAD868B36D; Thu, 24 Feb 2022 23:28:28 +0200 (EET) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9D2668B1E9; Thu, 24 Feb 2022 23:28:16 +0200 (EET) Received: by mail-yb1-f178.google.com with SMTP id p19so2072780ybc.6; Thu, 24 Feb 2022 13:28:16 -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=c2RrYnvGvxF9YvR7HN1AWAUpNo4Nw4ZLLpBX7/T5gV8=; b=CVWj1d0pl6w+aJOg+vJMbiKYTo4VVvGiJpX/DW4Z49D7U/6HnFCv0LAdzNzoqKBDoe qQeZOf4QuIeGuIz7KZdF16vTcwFewyXi7/SLM1wWp7XGb8VUosOiSClXVRV4i9NnZsxT z0L0Y22PEUdpKtukQw3JlyvoVZIdY3afFn+zEv9lnxoDcuvF/Sepn2PoPsN2Y4o2dKso STqTqsgHvU0RlZIHQnI63qVDGPc4MfQxpAyDxYP/dFjwQ4sTc+/cOpDsi7okbzBUmq/i nU9saH+NWDE4ClghWTZ08JrKR9I/P1aYvaQNnH4Zc9HWeqbY4VesBA3P2pHOHvc0j8v/ 4jYg== 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=c2RrYnvGvxF9YvR7HN1AWAUpNo4Nw4ZLLpBX7/T5gV8=; b=PF1V4pGFjyIIbWc73yLEzaulQkYN7wys/dlqW4BqUzAklyrjtrpNijA8cZHFOGD5Ve UdYeVbLAGCiwDHMwBknF8fQIxbc1pZDoj7UNCfiskSTCsK0iuMrL7cOg2l7ZiTampL/n LCeMqTFo6r9Hs5fHDDzsbYFIeMD8W+wUdGKQfTU/gBNNqwlQNq0PkPA7AQ48PoT6WIq/ GgnpMSgi1B4BgZDEXJy87liK67c71dvT1VV4ZMwUvAA619bG2o5LZsWU+h3+G3fdcZwb evbOoLcMKeoztU3f1cKpksVvDKGpeRiRSAlmtX9Nefv8Kb4z6kTNjPbxZY6LDffbzXdP L9+A== X-Gm-Message-State: AOAM531VKM2QK0kFvDQIL1QdkZxbqsU1U98HtA+vCUbhMOSFRmnpHi3R tq1LG6PsEhgTBDG+/hGgfl5pjERrkpQgIvd1caz+jkCf5xo= X-Google-Smtp-Source: ABdhPJwRGdLOodxcVgQ/+A+rVU3lhU3oQ81pVF+tirICYoFwJ0LJxAlMiqdIwzMOKUCr5d1xBJM7VVmZCA7Izh3irr8= X-Received: by 2002:a25:abb4:0:b0:625:5f2:5492 with SMTP id v49-20020a25abb4000000b0062505f25492mr4452179ybi.142.1645738095337; Thu, 24 Feb 2022 13:28:15 -0800 (PST) MIME-Version: 1.0 References: <20220224203039.CD4BB41059B@natalya.videolan.org> In-Reply-To: From: Paul B Mahol Date: Thu, 24 Feb 2022 22:29:43 +0100 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 10:12 PM Thierry Foucu wrote: > 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? > I doubt that, clone is clone, there is no point in padding stream that have no frames at all. > > 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". > _______________________________________________ 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".