From patchwork Fri Jul 7 09:48:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 42480 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp7162025pzh; Fri, 7 Jul 2023 02:50:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlG8n0uW3oV51KeTeBJJL39aFMsSVSnF/jYX+VaKT3MkjSQrLb/v1xuqU7jf/3xu3cKNYzKn X-Received: by 2002:a05:651c:104c:b0:2b6:c886:681 with SMTP id x12-20020a05651c104c00b002b6c8860681mr3102295ljm.6.1688723405206; Fri, 07 Jul 2023 02:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688723405; cv=none; d=google.com; s=arc-20160816; b=VNrd1PRRwjgKFYmMBkIw4y0O7Hm7GecjHH9fMoOmELOg42oy/Y8ocvNpu50DaP5usq 9MJhOhbp3A6cyJRT/y9CsZL2HNZbJcTiKYwtNyq8Joe6muUEyEGLnOXfVGx5Lb2KEjbg uDzCEssG7xKrMTXR73S3EbnCT3j7PdUt0JNHAFu/9BGH85Eco3Qf4nsyW/4bEof4f25n 0uq+kFqR0hSbOmUn+ruTQ9SXEaupEaUnRu7QfM0yBthj2UeYjV0K/N/7T4lpYWkxpMxc c/H/9lAX2hJ3q+xyYJh4repY3TAkVQ5LODok5orR+xD27o7YvsnLv54WuyZCsAcqclEA kQTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=nXD9/KBYra3ic5K6eO26bs+9S93EWLcIr9n4bkTwmUM=; fh=8ZF2QtiKOjBtyn9wuO2cMeZaLsE4aq02Bq77gGK61E8=; b=Qv4A534acbiaMl8accbA3FEuWdknb1erjWaOqIVzWiBsDgvrDghY593dzrfNE5up9/ P5jo/J3+g9HNJJwQLpv3H+I9RL3ocM5J8ASSpOOTagQMmCcuvKu2Tst7VAphrXkclrP2 1zqGwCwfIG3Dtsb+zqMxJ+79XsUGB8ASyEv3RoBEMzyEq3MoX4I72PakA4KGkro93Kay JB2w5KHI3vluV8nvzda0ELPkPLdRcGpLJB5K1CDxgVwfXmOe+aTJGc2dSNUEWRlPe2xv bg6UXIAIrMUflauaKHVeAo7yf2VrFlPkS/XVPCsy+RfWkuuZ7xjmUx0F/+3AiWttmZkU W7+w== 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 t13-20020aa7d70d000000b0051e16aa6441si2113964edq.191.2023.07.07.02.50.04; Fri, 07 Jul 2023 02:50:05 -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 3B9F368C7BE; Fri, 7 Jul 2023 12:49:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7368968C7BC for ; Fri, 7 Jul 2023 12:49:08 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 116752406CD for ; Fri, 7 Jul 2023 11:49:06 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id seSWjyyGOgRc for ; Fri, 7 Jul 2023 11:49:05 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 096F42406D0 for ; Fri, 7 Jul 2023 11:49:01 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 80D8B3A12C9 for ; Fri, 7 Jul 2023 11:48:54 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Jul 2023 11:48:32 +0200 Message-Id: <20230707094847.25324-7-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230707094847.25324-1-anton@khirnov.net> References: <20230707094847.25324-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/22] fftools/ffmpeg_filter: make sure no input or output is bound twice 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: kpv08IiBZHgB --- fftools/ffmpeg_filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 60e09866af..432e2fced9 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -595,6 +595,8 @@ static int ifilter_bind_ist(InputFilter *ifilter, InputStream *ist) InputFilterPriv *ifp = ifp_from_ifilter(ifilter); int ret; + av_assert0(!ifp->ist); + ifp->ist = ist; ifp->type_src = ist->st->codecpar->codec_type; @@ -654,6 +656,8 @@ void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost) FilterGraph *fg = ofilter->graph; const AVCodec *c = ost->enc_ctx->codec; + av_assert0(!ofilter->ost); + ofilter->ost = ost; av_freep(&ofilter->linklabel);