Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Subject: [FFmpeg-devel] [PATCH] all: s/Open/Allocate and initialize/ in comments
Date: Thu, 16 May 2024 13:23:01 +0100
Message-ID: <20240516122301.3789302-1-ffmpeg-devel@pileofstuff.org> (raw)

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".

                 reply	other threads:[~2024-05-16 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516122301.3789302-1-ffmpeg-devel@pileofstuff.org \
    --to=ffmpeg-devel@pileofstuff.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git