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 3EF9D4AC23 for ; Thu, 16 May 2024 12:23:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8F4668D47A; Thu, 16 May 2024 15:23:10 +0300 (EEST) Received: from b-painless.mh.aa.net.uk (unknown [81.187.30.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 61C7F68D362 for ; Thu, 16 May 2024 15:23:04 +0300 (EEST) Received: from 0.b.4.b.7.4.0.8.c.4.a.5.d.8.b.2.0.5.8.0.9.1.8.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:819:850:2b8d:5a4c:8047:b4b0] helo=andrews-2024-laptop.lan) by painless-b.tch.aa.net.uk with esmtp (Exim 4.96) (envelope-from ) id 1s7a8V-002h2N-1t; Thu, 16 May 2024 13:23:03 +0100 From: Andrew Sayers To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 May 2024 13:23:01 +0100 Message-ID: <20240516122301.3789302-1-ffmpeg-devel@pileofstuff.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] all: s/Open/Allocate and initialize/ in comments 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 Cc: Andrew Sayers 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: Comments for a few prominent functions claim to "open" something, when they actually "allocate and initialize" that thing. Using a different word misleads users into thinking it's doing a different thing, making the interface more time-consuming to learn. Replace "open" with the more standard "allocate and initialize". --- libavformat/avformat.h | 4 ++-- libavformat/avio.h | 4 ++-- libavutil/hwcontext.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8afdcd9fd0..2fb89807a1 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -2235,8 +2235,8 @@ int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt, unsigned int offset, unsigned int max_probe_size); /** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with avformat_close_input(). + * Allocate and initialize an input stream, then read the header. + * The codecs are not opened. The stream must be closed with avformat_close_input(). * * @param ps Pointer to user-supplied AVFormatContext (allocated by * avformat_alloc_context). May be a pointer to NULL, in diff --git a/libavformat/avio.h b/libavformat/avio.h index ebf611187d..1f56c58f9a 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -330,7 +330,7 @@ const char *avio_find_protocol_name(const char *url); int avio_check(const char *url, int flags); /** - * Open directory for reading. + * Allocate and initialize a directory for reading. * * @param s directory read context. Pointer to a NULL pointer must be passed. * @param url directory to be listed. @@ -707,7 +707,7 @@ int avio_closep(AVIOContext **s); /** - * Open a write only memory stream. + * Allocate and initialize a write only memory stream. * * @param s new IO context * @return zero if no error. diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h index bac30debae..be03f565f2 100644 --- a/libavutil/hwcontext.h +++ b/libavutil/hwcontext.h @@ -264,7 +264,8 @@ AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type); int av_hwdevice_ctx_init(AVBufferRef *ref); /** - * Open a device of the specified type and create an AVHWDeviceContext for it. + * Allocate and initialize a device of the specified type, + * and create an AVHWDeviceContext for it. * * This is a convenience function intended to cover the simple cases. Callers * who need to fine-tune device creation/management should open the device -- 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".