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 C36974A3AC for ; Wed, 27 Mar 2024 12:04:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93A3A68D64B; Wed, 27 Mar 2024 14:04:19 +0200 (EET) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C2C268D516 for ; Wed, 27 Mar 2024 14:04:12 +0200 (EET) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-566e869f631so7193314a12.0 for ; Wed, 27 Mar 2024 05:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711541051; x=1712145851; 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=8yZqf28NOTuPiCz7VbaMsUdPFRHRALn2MAxehESjZiY=; b=cRegp+X2XVtbGUKyLBLcJ5aRlb3b3x/I2TQYL7H+QHZ7r1z8VDphEO9ti9KdDpv0BR mp+ipmUxWBxXWNBuiOIBl1z6j4rI8+YIe+kQuNAfiFtk7WGWD1AAHxC8LqlqVdtN3XEZ EeXbX2X96ig4hlnWC7FofQ8UG+zDzRTqQGAe7IVt7Pd6AdD+0dCwGFtb/EnGgwlXO6de A3mMQaGYrsgCfdIYGQ4/QYko2UERvKLnihMkCGL6qvTsvrFqDrfWlKl6G/tJNY9b91Uw SD0f06ETdI6e3CoDmy8JDNkbR/8uzMo9izFLehA9ZcMjubPx+j7kqwryBnuTEwHWpv1G NXVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711541051; x=1712145851; 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=8yZqf28NOTuPiCz7VbaMsUdPFRHRALn2MAxehESjZiY=; b=rygzE+/oLDW8XrDitdKQCEazlhM14MT8/Pfvc0N2MgpAobF2jKsIKjFoi00ZP1khG8 npyS5LIAT9Wex/v2VEoQ0P3gWkbdYAYLepuWj8tUaz4ErpAWR29w8rYB+oQsdbM92Wj9 W7IATLteRkuGPiDDPBQzHvBzuTsVe8FZYiPvp72shDcC7rifOubTtXJqfldz/eU6IsZh Tlhho5t4XQVXlFjkYW2feQUlLZd0mt99tfSjHDo7JshSTkhxiUJvweRgrSi8xIzhlh9f otiNTKeOxi3Hec70hjcx2oY0xf3OojzFLox2+9dzEZq3zaTB5v+UCzOJb7vmRHCnORfB hLyg== X-Gm-Message-State: AOJu0Yxbipjrv38YMF3JMKZ+HuRsaaTnpE8LX/g+Hps3jyiEp834BDZn U1xjKb/JCw04XhoDyhvdfMQtVsOoTEL2+c2t+boToxUQWrO/xC6jIR5wvy65 X-Google-Smtp-Source: AGHT+IGzwyzoM9J0Nnwd2QRAzyyi2taGJrSKVw7EYm1AQPz2VPaWANXxdksBFQvSu3tU3vY6P3cmWw== X-Received: by 2002:a50:d49e:0:b0:56c:2a90:9c29 with SMTP id s30-20020a50d49e000000b0056c2a909c29mr876496edi.28.1711541050678; Wed, 27 Mar 2024 05:04:10 -0700 (PDT) Received: from mariano (net-93-70-84-101.cust.vodafonedsl.it. [93.70.84.101]) by smtp.gmail.com with ESMTPSA id fk26-20020a056402399a00b0056c2bd89354sm1684249edb.14.2024.03.27.05.04.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 05:04:10 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 2224EBFCEA; Wed, 27 Mar 2024 13:04:09 +0100 (CET) Date: Wed, 27 Mar 2024 13:04:09 +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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1711536691-15749-1-git-send-email-t.rapp@noa-archive.com> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 1/2] examples/decode_filter_audio: 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:30 +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_audio.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/doc/examples/decode_filter_audio.c b/doc/examples/decode_filter_audio.c > index 2046419..196f080 100644 > --- a/doc/examples/decode_filter_audio.c > +++ b/doc/examples/decode_filter_audio.c > @@ -279,6 +279,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; > + if (ret < 0) > + goto end; > + print_frame(filt_frame); > + av_frame_unref(filt_frame); > + } > + } > + > end: > avfilter_graph_free(&filter_graph); > avcodec_free_context(&dec_ctx); Should be fine, thanks. _______________________________________________ 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".