Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marton Balint <cus@passwd.hu>
To: ffmpeg-devel@ffmpeg.org
Cc: Marton Balint <cus@passwd.hu>
Subject: [FFmpeg-devel] [PATCH 3/4] avfilter/af_afade: fix check_input for empty streams
Date: Thu, 24 Jul 2025 01:35:59 +0200
Message-ID: <20250723233604.29380-3-cus@passwd.hu> (raw)
In-Reply-To: <20250723233604.29380-1-cus@passwd.hu>

Use ff_outlink_get_status directly to get pending EOF state.

Fixes assertion failure with:
ffmpeg -lavfi "sine=f=1000:d=2[a];sine=f=440:d=2,atrim=end=0[b];[a][b]acrossfade=d=1" -f framecrc -
ffmpeg -lavfi "sine=f=1000:d=2,atrim=end=0[a];sine=f=440:d=2[b];[a][b]acrossfade=d=1" -f framecrc -

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/af_afade.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index b006420111..baf972d17d 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -541,13 +541,6 @@ CROSSFADE(flt, float)
 CROSSFADE(s16, int16_t)
 CROSSFADE(s32, int32_t)
 
-static int check_input(AVFilterLink *inlink)
-{
-    const int queued_samples = ff_inlink_queued_samples(inlink);
-
-    return ff_inlink_check_available_samples(inlink, queued_samples + 1) == 1;
-}
-
 static int pass_frame(AVFilterLink *inlink, AVFilterLink *outlink, int64_t *pts)
 {
     AVFrame *in;
@@ -675,10 +668,10 @@ static int activate(AVFilterContext *ctx)
                ff_inlink_queued_samples(ctx->inputs[1]) >= s->nb_samples) {
         return pass_crossfade(ctx);
     } else if (ff_outlink_frame_wanted(outlink)) {
-        if (!s->status[0] && check_input(ctx->inputs[0]))
+        if (!s->status[0] && ff_outlink_get_status(ctx->inputs[0]))
             s->status[0] = AVERROR_EOF;
         s->passthrough = !s->status[0];
-        if (check_input(ctx->inputs[1])) {
+        if (ff_outlink_get_status(ctx->inputs[1])) {
             s->status[1] = AVERROR_EOF;
             ff_outlink_set_status(outlink, AVERROR_EOF, AV_NOPTS_VALUE);
             return 0;
-- 
2.43.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".

  parent reply	other threads:[~2025-07-23 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 23:35 [FFmpeg-devel] [PATCH 1/4] avfilter/trim: consume all available frames and avoid activate reschedule Marton Balint
2025-07-23 23:35 ` [FFmpeg-devel] [PATCH 2/4] avfilter/af_afade: factorize functions generating frames Marton Balint
2025-07-23 23:35 ` Marton Balint [this message]
2025-07-23 23:36 ` [FFmpeg-devel] [PATCH 4/4] avfilter/af_afade: rework crossfade activate logic Marton Balint

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250723233604.29380-3-cus@passwd.hu \
    --to=cus@passwd.hu \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git