From patchwork Mon Jul 17 14:19:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4328 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp208682vsb; Mon, 17 Jul 2017 07:19:38 -0700 (PDT) X-Received: by 10.28.88.9 with SMTP id m9mr5070538wmb.57.1500301178576; Mon, 17 Jul 2017 07:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500301178; cv=none; d=google.com; s=arc-20160816; b=rzuj6W6faFmp+XODvpp8vTF+CS5erhEf0Ujtpw+hfdNEkw5lSiiRE+/lc1JJjFzCuO zLWBNjzCUJg0v8Tyklol3S6iP+QF2npD3KOOykymBCvNjbMIUUBOysnRour7b0jeV9j2 ck8m2Q0Bj0TNj43zziLhScy9/yLw6JbzaF0MatSkYE7tH5jsessDhLSMWEa7xxP+Cf2R eLtiZVsst9C8o5Csp/st0NEfuKmTvGnU8N+U5U+fp4nLHguQcKrfczObOM5Ocz0RBtaB 3BrcK1haTNT+AimK1VSGVWcGcvRII9iKvyYg1fBKqE5jxsGlUQs/+ngLtJ6I9fYHefGx mp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=bv7vnHa8F2fl+de85Ufs8JR1aVAaI9izwnvVaDknFAo=; b=vo+Z+Pnr7t+TO0wyrP1hMmAfYp/+L7hqtHaSxK5r64DujfXgeIYq7DMQu6s99F9e2a K8XUdzyIF7hyKsI64UVnn5ibyVqEG1x3BOr8i+bW8lkMP9KUM/+N1790SYT66DllCPB1 nxj48hbyydvn40CGA18hbhklBfl15Oc6RLBRHSCJHScnBr0+Clnu7YlnFlOpNubJ7zu8 e6wq6h2+w+2W81XADIg9IPM6VhbWikfxHKJWiamoAxyLcr2203e89yI2opU+hx1ePxCt 8wduVZ5Wdo7syX+ZrQdalkAoXARV9grsK3Cz02apkNMyxWkrx5utsOul9c1l8CaUbB9S zNzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t72si9976770wmt.135.2017.07.17.07.19.37; Mon, 17 Jul 2017 07:19:38 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D37E5689213; Mon, 17 Jul 2017 17:19:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C0C8468839B for ; Mon, 17 Jul 2017 17:19:21 +0300 (EEST) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v6HEJSg3039873 for ; Mon, 17 Jul 2017 16:19:28 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 3657CE00D0; Mon, 17 Jul 2017 16:19:28 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2017 16:19:20 +0200 Message-Id: <20170717141926.7442-1-george@nsup.org> X-Mailer: git-send-email 2.13.2 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Mon, 17 Jul 2017 16:19:28 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/7] Revert "Revert "lavfi/buffersrc: push the frame deeper if requested."" X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This reverts commit 04aa09c4bcf2d5a634a35da3a3ae3fc1abe30ef8. The fate-ffm change is caused by field_order now being set on the output format because the first frame arrives earlier. The fate-mxf change is assumed to be the same. Signed-off-by: Nicolas George --- libavfilter/buffersrc.c | 25 +++++++++++++++++++++++++ tests/ref/lavf/ffm | 2 +- tests/ref/lavf/mxf | 6 +++--- 3 files changed, 29 insertions(+), 4 deletions(-) The field_order info seems to not be printed by any tool, and I do not know the MXF format to check directly in the file; with FFM it was easy to see in a hexdump. Anyway, the fact that field order was not set before de-reverting hints at something fishy happening in the initialization code of ffmpeg. I do not have time nor motivation to investigate that, so I will assume the change is for the best like FFM. If someone wants to investigate, the change can be toggled by simply adding "return 0" at the beginning of push_frame(), below. diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 587b29b91a..e8f59c2de7 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -173,6 +173,20 @@ int attribute_align_arg av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFra return ret; } +static int push_frame(AVFilterGraph *graph) +{ + int ret; + + while (1) { + ret = ff_filter_graph_run_once(graph); + if (ret == AVERROR(EAGAIN)) + break; + if (ret < 0) + return ret; + } + return 0; +} + static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags) { @@ -185,6 +199,11 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, if (!frame) { s->eof = 1; ff_avfilter_link_set_in_status(ctx->outputs[0], AVERROR_EOF, AV_NOPTS_VALUE); + if ((flags & AV_BUFFERSRC_FLAG_PUSH)) { + ret = push_frame(ctx->graph); + if (ret < 0) + return ret; + } return 0; } else if (s->eof) return AVERROR(EINVAL); @@ -239,6 +258,12 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, if ((ret = ctx->output_pads[0].request_frame(ctx->outputs[0])) < 0) return ret; + if ((flags & AV_BUFFERSRC_FLAG_PUSH)) { + ret = push_frame(ctx->graph); + if (ret < 0) + return ret; + } + return 0; } diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm index 54c56034aa..d9fa8d52cb 100644 --- a/tests/ref/lavf/ffm +++ b/tests/ref/lavf/ffm @@ -1,3 +1,3 @@ -a0e9616f0d9a8c1029f3220b1b9175f4 *./tests/data/lavf/lavf.ffm +ca2a450cd0d1e299514a345923b4c82a *./tests/data/lavf/lavf.ffm 376832 ./tests/data/lavf/lavf.ffm ./tests/data/lavf/lavf.ffm CRC=0x000e23ae diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 9ab4432c63..48fe95a235 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -dbdbb7d8677dc29b0d90eedcf418ce13 *./tests/data/lavf/lavf.mxf +eaac3125ac1a61fe5f968c7af83fa71e *./tests/data/lavf/lavf.mxf 525369 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab -40fcb0a898f8825a17f5754b23762f49 *./tests/data/lavf/lavf.mxf +1562530330b13e9e70f522fe20265632 *./tests/data/lavf/lavf.mxf 560697 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48 -9233d192af20fc2a89304f5ae93c21ee *./tests/data/lavf/lavf.mxf +e07858715997313ae66a1cdd6fde5f66 *./tests/data/lavf/lavf.mxf 525369 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab