This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit fb8a12db17e2c7bb3b6f3618c333fc8364190c3c Author: Andreas Rheinhardt <[email protected]> AuthorDate: Fri Jan 30 18:40:32 2026 +0100 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Tue Feb 10 19:44:46 2026 +0100 avutil/opt: Improve type-safety In particular, make this code -fshort-enums compatible. The branch can be optimized away by compilers when sizeof(enum AVPixelFormat) == sizeof(enum AVSampleFormat). Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavutil/opt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 911e064914..7c6a01068a 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1336,7 +1336,7 @@ int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRatio return av_opt_get_q(obj, name, search_flags, out_val); } -static int get_format(void *obj, const char *name, int search_flags, int *out_fmt, +static int get_format(void *obj, const char *name, int search_flags, void *out_fmt, enum AVOptionType type, const char *desc) { void *dst, *target_obj; @@ -1350,7 +1350,11 @@ static int get_format(void *obj, const char *name, int search_flags, int *out_fm } dst = ((uint8_t*)target_obj) + o->offset; - *out_fmt = *(int *)dst; + if (type == AV_OPT_TYPE_PIXEL_FMT) + *(enum AVPixelFormat *)out_fmt = *(enum AVPixelFormat *)dst; + else + *(enum AVSampleFormat*)out_fmt = *(enum AVSampleFormat*)dst; + return 0; } _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
