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 66B26424BD for ; Mon, 17 Jan 2022 22:30:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D191268B087; Tue, 18 Jan 2022 00:30:02 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C907F68B015 for ; Tue, 18 Jan 2022 00:29:56 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1EADA24017C for ; Mon, 17 Jan 2022 23:29:56 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id z39yVHemOkRJ for ; Mon, 17 Jan 2022 23:29:55 +0100 (CET) Received: from lain.red.khirnov.net (lain.red.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.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 7C047240179 for ; Mon, 17 Jan 2022 23:29:55 +0100 (CET) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id AC9A116008E; Mon, 17 Jan 2022 23:29:55 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: =?utf-8?q?=3CAM7PR03MB6660666D148524DDD35EBCAA8F539=40AM7PR03MB?= =?utf-8?q?6660=2Eeurprd03=2Eprod=2Eoutlook=2Ecom=3E?= References: <20220111095830.31542-1-anton@khirnov.net> <20220111095830.31542-17-anton@khirnov.net> =?utf-8?q?=3CAM7PR03MB6660666D1?= =?utf-8?q?48524DDD35EBCAA8F539=40AM7PR03MB6660=2Eeurprd03=2Eprod=2Eoutlook?= =?utf-8?q?=2Ecom=3E?= Mail-Followup-To: FFmpeg development discussions and patches Date: Mon, 17 Jan 2022 23:29:55 +0100 Message-ID: <164245859543.20480.16148065827824330436@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 17/28] ffmpeg: move the mux queue into muxer private data 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 Andreas Rheinhardt (2022-01-13 11:50:48) > > My objections to adding a separately allocated muxing context and to > this MuxStream have not changed. Both incur unnecessary allocations > and indirections and (in case of the latter) loops; I cannot imagine any remotely real situation where the cost of these allocation and loops is anywhere close to being meaningful. So your argument amounts to vastly premature optimization. > the latter is also very unnatural. The patch here actually shows it: > You only use the muxer context to get the MuxStream context > corresponding to the OutputStream you are interested in: I don't see how that shows any unnaturalness. As I said last time already - the idea is to (eventually) split OutputStream into separate encoding and muxing objects that can be used independently. If you really insist I can wait until actually implementing that split, but I'd rather avoid giant branches if possible. > > > for (i = 0; i < of->ctx->nb_streams; i++) { > > + MuxStream *ms = &of->mux->streams[i]; > > OutputStream *ost = output_streams[of->ost_index + i]; > > > AVStream *st = ost->st; > > + MuxStream *ms = &of->mux->streams[st->index]; > > int ret; > > Your aim of making sure what code can use/modify what parts can also be > fulfilled by comments. In my experience that simply does not work. People either don't read the comments at all or read them once and forget. Did you see what happened to all those fields in AVStream marked as "libavformat private use only"? -- 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".