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 B51F1477E8 for ; Sun, 21 Jan 2024 17:39:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C7F1A68CD05; Sun, 21 Jan 2024 19:39:26 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54A9B68B3C3 for ; Sun, 21 Jan 2024 19:39:20 +0200 (EET) Authentication-Results: mail0.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=rr95PXoP; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C95782405F2 for ; Sun, 21 Jan 2024 18:39:19 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Wm7y9FXY_ih4 for ; Sun, 21 Jan 2024 18:39:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1705858759; bh=ajIm1msQvwl8wMOzKmgRFGj9TFEEJue2ivFdw7J4qs0=; h=Subject:From:To:In-Reply-To:References:Date:From; b=rr95PXoPv9Q+GIRkHPUREHCG//3hDbO/uvMTTL4h7w1qg8ml+V3Xzx2JvWCe5LIm1 5jJvhaFAMhLAGxDeGt5oZkI+ph7VOUuYvZELPM5TN8OazFygU5JdqV0Z7lrO5rKc6j A/aobDl5uEEITEaJxeFEzIKCYNsRoA3ngAfCrGBYr+F06RFP1+Lr7TBpY+Ns32ZyDw czpeBTwAhb0j7bqKgum29DViP+Ls7KC9zJE/tEKH1/XwnNGEpdYCVexMYzGr2tXJ48 XA+aMjdajem58CCsThei/BAtgW//50KcMoRbwx1+/GfOnyhXfj/idGjW5leWxZ89Ke 8Tc1v+r3gQ+vQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 401A82404E5 for ; Sun, 21 Jan 2024 18:39:19 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 2059D1601B9; Sun, 21 Jan 2024 18:39:19 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20240120152408.606235-1-stefasab@gmail.com> <170581900840.8914.5686749055175923589@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Sun, 21 Jan 2024 18:39:19 +0100 Message-ID: <170585875910.8914.4454628093045693157@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavf/dvenc: improve error messaging 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: Quoting Stefano Sabatini (2024-01-21 11:30:27) > > > - if (((c->n_ast > 1) && (c->sys->n_difchan < 2)) || > > > - ((c->n_ast > 2) && (c->sys->n_difchan < 4))) { > > > - /* only 2 stereo pairs allowed in 50Mbps mode */ > > > - goto bail_out; > > > + if ((c->n_ast > 1) && (c->sys->n_difchan < 2)) { > > > + av_log(s, AV_LOG_ERROR, > > > + "Invalid number of channels %d, only 1 stereo pairs is allowed in 25Mps mode.\n", > > > + c->n_ast); > > > + return AVERROR_INVALIDDATA; > > > + } > > > + if ((c->n_ast > 2) && (c->sys->n_difchan < 4)) { > > > + av_log(s, AV_LOG_ERROR, > > > + "Invalid number of channels %d, only 2 stereo pairs are allowed in 50Mps mode.\n", > > > + c->n_ast); > > > + return AVERROR_INVALIDDATA; > > > > > Surely this can be done in one log statement. > > Yes, but this would complicate the logic for small gain. More complicated than duplicating 5 lines? I wouldn't say so, not to mention the string also has to be duplicated in the binary. Also, can the second case even trigger? Seems like the block above ensures n_ast is never larger than 2. > > > - " video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM\n" > > > > + " video: 25fps or 29.97fps, audio: 2ch/48000|44100|32000Hz/PCM\n" > > > > This does not seem like an improvement. > > 44kHz != 44100 > > I could use 44.1 but this is not the unit used when setting the > option It can be. -- Anton Khirnov _______________________________________________ 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".