diff mbox series

[FFmpeg-devel,1/3] avutil/opt: add a note about the av_opt_set_chlayout() behavior

Message ID 20240506152704.1596-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avutil/opt: add a note about the av_opt_set_chlayout() behavior | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer May 6, 2024, 3:27 p.m. UTC
Based on the one for av_opt_set_dict_val().

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/opt.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andreas Rheinhardt May 6, 2024, 3:43 p.m. UTC | #1
James Almer:
> Based on the one for av_opt_set_dict_val().
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavutil/opt.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 2d76ec6105..1b30a32317 100644
> --- a/libavutil/opt.h
> +++ b/libavutil/opt.h
> @@ -797,6 +797,10 @@ int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_
>  int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags);
>  int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags);
>  int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags);
> +/**
> + * @note Any old chlayout present is discarded and replaced with a copy of the new one. The
> + * caller still owns layout is and responsible for uninitializing it.

FFSWAP(is, and)

(Apart from this: The behaviour is clear from the fact that
av_opt_set_chlayout() accepts a pointer to const.)

> + */
>  int av_opt_set_chlayout(void *obj, const char *name, const AVChannelLayout *layout, int search_flags);
>  /**
>   * @note Any old dictionary present is discarded and replaced with a copy of the new one. The
diff mbox series

Patch

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 2d76ec6105..1b30a32317 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -797,6 +797,10 @@  int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_
 int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags);
 int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags);
 int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags);
+/**
+ * @note Any old chlayout present is discarded and replaced with a copy of the new one. The
+ * caller still owns layout is and responsible for uninitializing it.
+ */
 int av_opt_set_chlayout(void *obj, const char *name, const AVChannelLayout *layout, int search_flags);
 /**
  * @note Any old dictionary present is discarded and replaced with a copy of the new one. The