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 07DE54A3B0 for ; Wed, 27 Mar 2024 12:07:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6654668D651; Wed, 27 Mar 2024 14:07:04 +0200 (EET) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0CF3F68D4BD for ; Wed, 27 Mar 2024 14:06:58 +0200 (EET) Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-56c3260a714so1659970a12.3 for ; Wed, 27 Mar 2024 05:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711541217; x=1712146017; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=w8caeKKDMW+y5njrmLscvsbiKQYAA8bAEwngBsIwZR0=; b=llxTKddZUQfxB8UwVpEleAtFmsUsgPWQxu4W1ibztX1CIM7RauQoR+WbRcnDYPCJei TXgE4/dr35V0R1exR3t9GsA7krwK74aaHxL1K5o05WY0lGU6TuUyQo1aLy5e2BDIwXLv LuCMjzilrIUzSC62tqtoIrePAc/S3VoLNdPRp20g9rGkuC3uaz5f5aoWPvO0nr+aW4wk gngZ45F3Av697g0c86Y/jL9IgAeTKnvgnUdCdDvyM/JTMrjrsGotdsBSjFwzOInN8yK4 G2GhbxfgVZa7l/bNpp/FHv70XA8QPZiZtK5JGAOIgZRZDF21kLWYy/heu+hV1cuqYrgB OVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711541217; x=1712146017; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=w8caeKKDMW+y5njrmLscvsbiKQYAA8bAEwngBsIwZR0=; b=llx6nPtwd402DY9IXmk5otqyJv9yugKk/F4IDaErau7hXbEmUaF8E/qE7+P4ryiaP+ JWmIXBqRocTxv631/jvXOkpXFSlVYys9Lgq76TOzbIZhbSuL6NmEatSwA6k0w/cYn71C d1r656GNtFCNcUBVrYSLu76d7rTnzyBrfpKQQFg9zvkFPvEOpOI/5Pi8q2Dw/Z9oelNi Q1yhmoopAElQUSJ9GZPv73njlk8q6ci67VZnZm27trqll2KT8hHTm65DE1HRue42q7+X 9n2UGtZmty80AevubKBm8mwsdfVOknoouafr+XSDz5Bz7DA7bKt48p3KEdv1FesNfrk+ vfNw== X-Gm-Message-State: AOJu0YwyqgDlrPjxioo6oGYscB1lvs1yPEmGxkdEiP20tOhhXvDDX0Bm nMDJ/wHmvTMmHF9ItgyRY0V57GYwOY+MQ/y5oBY4sbtMqgl3g6kHnmWmKqSS X-Google-Smtp-Source: AGHT+IHIeBQpetdZvmi8bMZETafLoNmOrh5yw91n08QOQw82JxMYVQx9LEAUOgSrBi4fGyLLO5Gszw== X-Received: by 2002:a17:906:f42:b0:a46:13d8:c173 with SMTP id h2-20020a1709060f4200b00a4613d8c173mr1741122ejj.33.1711541216704; Wed, 27 Mar 2024 05:06:56 -0700 (PDT) Received: from mariano (net-93-70-84-101.cust.vodafonedsl.it. [93.70.84.101]) by smtp.gmail.com with ESMTPSA id bo11-20020a170906d04b00b00a46d049ff63sm5282548ejb.21.2024.03.27.05.06.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 05:06:56 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 1B8A2BFCE4; Wed, 27 Mar 2024 13:06:55 +0100 (CET) Date: Wed, 27 Mar 2024 13:06:55 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <1711536691-15749-1-git-send-email-t.rapp@noa-archive.com> <1711536691-15749-2-git-send-email-t.rapp@noa-archive.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1711536691-15749-2-git-send-email-t.rapp@noa-archive.com> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 2/2] examples/decode_filter_video: Add loop for draining the filtergraph 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 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 Wednesday 2024-03-27 11:51:31 +0100, Tobias Rapp wrote: > Depending on the filters used the filtergraph can produce trailing data > after feeding it the last input frame. Update the example to include the > necessary loop for draining the filtergrap. > > Signed-off-by: Tobias Rapp > --- > doc/examples/decode_filter_video.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/doc/examples/decode_filter_video.c b/doc/examples/decode_filter_video.c > index 454c192..a57e6df 100644 > --- a/doc/examples/decode_filter_video.c > +++ b/doc/examples/decode_filter_video.c > @@ -276,6 +276,25 @@ int main(int argc, char **argv) > } > av_packet_unref(packet); > } > + if (ret == AVERROR_EOF) { > + /* signal EOF to the filtergraph */ > + if (av_buffersrc_add_frame_flags(buffersrc_ctx, NULL, 0) < 0) { > + av_log(NULL, AV_LOG_ERROR, "Error while closing the filtergraph\n"); > + goto end; > + } > + > + /* pull remaining frames from the filtergraph */ > + while (1) { > + ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); > + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) > + break; how are we supposed to handle the EAGAIN case? Shouldn't this be a sleep and retry? _______________________________________________ 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".