Quoting Marton Balint (2024-02-26 20:38:46)
> The more I think about it, it is actually a broader problem.
> 
> You are changing the semantics of existing AV_OPT_TYPE_xxx types. So 
> previously an option with AV_OPT_TYPE_STRING used to have default value in 
> default_val.str. After your patch, it will be either default_val.str, or 
> default_val.str[1], based on if it is an array or not.
> 
> I think the API user safely assumed that if the option type is known to 
> him, he will always find the default value in the relevant default_val 
> field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT, 
> because previously to get the default value AVOption->default_val.i64 was 
> used, and now .str[1] should be instead...

In my view the semantics of default_val (and offset) are only defined
when declaring options on your own object, not when accessing those
fields when declared by some other code. I also see no good reason for
any user to read these fields.

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to