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 D7E3747F96 for ; Fri, 5 Apr 2024 16:13:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6AB0F68CCFE; Fri, 5 Apr 2024 19:13:11 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D9C968D10C for ; Fri, 5 Apr 2024 19:13:04 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=O/jRJ458; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6870225F for ; Fri, 5 Apr 2024 18:13:03 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id SuRssl6cdNdO for ; Fri, 5 Apr 2024 18:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712333581; bh=tUwM9Blnv46o5ZFLkpyFlRlohowJDflbNWM+HWJgm1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=O/jRJ458URmPa0U7aaVssr9BgDCMfSagMcn9jpu5JYRCVgnTmdKUV0HPxRiTCayaY 0gPygZLsK4XDK0BQZk55f87pY4Kwy5axdTIWYWbDgWgO5aqkCIDb67fOeDA+jKvQO3 32+EYAaWrLRqUJhV3vfDIDnoxEkG7qjPUdD5N8hcjbjuPip3B+iKLRqJ8Ch6mPsxyR ynibcB7WAvj0Gr/ff7FYZ4VhQ+bBCNU5R4yWsMx5FyJcrXVnuA6UIZX2voBD7zjkp1 uuv2HMQIhrT+O/uzgPpHWZ0nkKbeQeCe7uljtiy8Tzl4FH6d/U71AeRKxSCcDc7weZ C9WCvHJSvMiXQ== 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 mail1.khirnov.net (Postfix) with ESMTPS id E7B7C4D48 for ; Fri, 5 Apr 2024 18:13:01 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A2E6A3A0C79 for ; Fri, 5 Apr 2024 18:12:55 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2024 18:11:46 +0200 Message-ID: <20240405161212.26167-5-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405161212.26167-1-anton@khirnov.net> References: <20240405161212.26167-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/31] fftools/ffmpeg_filter: check that filter type matches output stream type 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: For simple filtergraphs. For complex filtergraphs they always match. --- fftools/ffmpeg_filter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 0d359303f7..a59c61b312 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -773,6 +773,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, int ret; av_assert0(!ofilter->ost); + av_assert0(ofilter->type == ost->type); ofilter->ost = ost; av_freep(&ofilter->linklabel); @@ -1106,6 +1107,13 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost, graph_desc, fg->nb_inputs, fg->nb_outputs); return AVERROR(EINVAL); } + if (fg->outputs[0]->type != ost->type) { + av_log(fg, AV_LOG_ERROR, "Filtergraph has a %s output, cannot connect " + "it to %s output stream\n", + av_get_media_type_string(fg->outputs[0]->type), + av_get_media_type_string(ost->type)); + return AVERROR(EINVAL); + } ost->filter = fg->outputs[0]; -- 2.43.0 _______________________________________________ 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".