Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] all: s/Open/Allocate and initialize/ in comments
@ 2024-05-16 12:23 Andrew Sayers
  0 siblings, 0 replies; only message in thread
From: Andrew Sayers @ 2024-05-16 12:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andrew Sayers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-16 12:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-16 12:23 [FFmpeg-devel] [PATCH] all: s/Open/Allocate and initialize/ in comments Andrew Sayers

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