From patchwork Fri May 5 18:56:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 41502 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp708140pzb; Fri, 5 May 2023 11:57:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6C82PS1O2sOMjE4yTuKGrVKM13jWuVT5DqTVym/99JVFyEibnI1UGVvtWLYMPkBGEAFZ8K X-Received: by 2002:a05:6402:458:b0:506:b228:7aff with SMTP id p24-20020a056402045800b00506b2287affmr2185396edw.23.1683313024238; Fri, 05 May 2023 11:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683313024; cv=none; d=google.com; s=arc-20160816; b=UhEo/AsKKwd7E3JF8yn0sl3yDZXne5WUEKsQGvqJUeBrAT+lBeLXAXGd+MoCaAS43N mLJJPqfxNBejtYPhsswrEjVMEPWRn3JD0J/uaYTdwVibbDFTk3bRFXjfPPhUNu/t8+F3 dWL+otOxV7vOQu3EkI3FzcmbCgo5x+75VUvI9sUOWDpkfwwX2N2hGa4MgXDuCR30+rD9 Bu2J5qNaNroTdRgLmvq+9kJzS2J5prhng8+yyWerVnqtyV/iR9l4C8Za873OyU/ok8aH cei7zngDk9zdCL74qcFyYplwokD8P+MphVRfVIL5mSEQO+UQUHjIHFnp2Pj7B5gqKbrZ VaXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=Jis1YnGG0D1I8dg50W0hti/GtWLGQbL6/0DbgCtNwAE=; b=W0/SHjtFC/dG7iAWQVpg005Yy3NZ012WxGtlMw4PU4gTeoxSl0KeTAPm77ynaxu2Pe /EZRczSHuVWhO+tRBEVbfCw7gWp9X+EVak5CYh1kP9qkpXV/2gL+sKnwaYxEpwML5qAC gF5eeUA3qLsJvmBWhML8V/TP4mYnpXgZFE8cyyjTWo8MdojUqXq1doq3X7VJFI5raWuc qXU7TSgzpoyxWyjl2DCDjW+xicEd+Jw2etb1C2zhJ0IU8fuYfeZel8f3+onKixzaQn5F N5z1ca8wY49G5PYDBSanMvIfMzCb6mGovaVxfoRmOUf9zkGa/r0whgFQV/A5P3yeNZaX EIMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=VU8ecUsB; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a17-20020aa7d911000000b0050bc014786esi5385082edr.33.2023.05.05.11.57.03; Fri, 05 May 2023 11:57:04 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=VU8ecUsB; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20CDB68C144; Fri, 5 May 2023 21:56:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 44A9668BD34 for ; Fri, 5 May 2023 21:56:51 +0300 (EEST) Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-434834245c3so202529137.0 for ; Fri, 05 May 2023 11:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683313010; x=1685905010; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2WPNIq/8yF/ffwGFFd4lP6mLLH8amefgCPkR50QAyds=; b=VU8ecUsBFI8+GT46TRUo27wQIuWRdEoJQMqmiHvi+sIPFOVvo9Xb8BiYE18X/Qs9XL S8qKKyQd+aNgElhu6jjpq6RqF50c0AuyR2umj+xqMqzJbE87gv60tznXy0Ni1H+RGOgz 6yu8QgrJ5pRN5LH8KLgeWqM6mMiFZTLes9jAkdZ1wK9lVAguQdB23Wo9vlW9FqX6RozO FO0zYvX44rqNh5+GscLDp6//vsUb9pG3g1cP47pADd60axh2GEkK7izRC/HYd/Jur9fj m2aEKBO8S6QBRpna/tmasoaOea2yBi3mzQ9+cMLsktYZ6C8dcEkheKJwDLJNDOpO12n/ gh6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683313010; x=1685905010; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2WPNIq/8yF/ffwGFFd4lP6mLLH8amefgCPkR50QAyds=; b=eI2jYtm6/2xfHDatcWrwEKRxcIrxDb8P0m0SHsoy3DfOGXXysXV0NZOY14AeEuXcSM hptak73NVgaEU8YXueVJs+bwHFwNlbsul6ndA/8pB89uVXDlyHSi0X5Air2j1CpuBltA NbGk/XVQ6My1wB6cA0duR/p2ZbuIznJbMOeqVoD7ndwJ6ra23DL/3bDjhuIMI4aCzk9h 8TIEeoa/3Ku03MzoBq03+XYLU/ADCmnX/EmkYfJdQ0lYQ7l3Wdw5dB+uIgn5fN9Dv8bF ST/E2/IY+6ljmjUrJxZYSc/igO9Ao7TWIotvb68FSD1fBqBE/C1fRkFkRhWiMODKTa/Z KZvw== X-Gm-Message-State: AC+VfDz78cG9dK+wuv/uO8uTldNHpf2niE1HI64MUoJ3C/pW6qxHZNPM TKy8ZSfP5ac1SVNeNNL6w2YZ+7L8d8yteORzA+RVRV4o X-Received: by 2002:a05:6102:3a66:b0:42c:7d66:659 with SMTP id bf6-20020a0561023a6600b0042c7d660659mr941319vsb.23.1683313010202; Fri, 05 May 2023 11:56:50 -0700 (PDT) MIME-Version: 1.0 From: Paul B Mahol Date: Fri, 5 May 2023 20:56:24 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] asetnsamples: add commands and timeline support 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Rc/i0Q++uQIk Attached. From 462bbdc3cb8516da9f0f752fa43254413666a425 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 5 May 2023 20:53:39 +0200 Subject: [PATCH 2/2] avfilter/af_asetnsamples: add timeline support Signed-off-by: Paul B Mahol --- libavfilter/af_asetnsamples.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c index fe6d40f9ca..20cc70ce4a 100644 --- a/libavfilter/af_asetnsamples.c +++ b/libavfilter/af_asetnsamples.c @@ -61,12 +61,15 @@ static int activate(AVFilterContext *ctx) FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); - ret = ff_inlink_consume_samples(inlink, s->nb_out_samples, s->nb_out_samples, &frame); + if (ctx->is_disabled) + ret = ff_inlink_consume_frame(inlink, &frame); + else + ret = ff_inlink_consume_samples(inlink, s->nb_out_samples, s->nb_out_samples, &frame); if (ret < 0) return ret; if (ret > 0) { - if (!s->pad || frame->nb_samples == s->nb_out_samples) + if (!s->pad || ctx->is_disabled || frame->nb_samples == s->nb_out_samples) return ff_filter_frame(outlink, frame); pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples); @@ -123,5 +126,6 @@ const AVFilter ff_af_asetnsamples = { FILTER_INPUTS(asetnsamples_inputs), FILTER_OUTPUTS(asetnsamples_outputs), .activate = activate, + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, .process_command = ff_filter_process_command, }; -- 2.39.1