> 在 2023年5月2日,19:39,James Almer <jamr...@gmail.com> 写道:
> 
> On 5/2/2023 8:34 AM, Tomas Härdin wrote:
>> tis 2023-05-02 klockan 15:48 +0800 skrev Zhao Zhili:
>>> From: Zhao Zhili <zhiliz...@tencent.com>
>>> 
>>> Signed-off-by: Zhao Zhili <zhiliz...@tencent.com>
>>> ---
>>>  libavutil/opt.h     | 2 ++
>>>  libavutil/version.h | 1 +
>>>  2 files changed, 3 insertions(+)
>>> 
>>> diff --git a/libavutil/opt.h b/libavutil/opt.h
>>> index 461b5d3b6b..46915754ea 100644
>>> --- a/libavutil/opt.h
>>> +++ b/libavutil/opt.h
>>> @@ -271,8 +271,10 @@ typedef struct AVOption {
>>>          int64_t i64;
>>>          double dbl;
>>>          const char *str;
>>> +#if FF_API_AVOPTION_AVRATIONAL
>>>          /* TODO those are unused now */
>>>          AVRational q;
>>> +#endif
>> Surely rationals options are useful?
> 
> They are, but this union is where the default value is stored when you define 
> an AVOption. At some point it seems it was decided that rational (and 
> video_rate) type AVOptions should set dbl instead of q, which is then 
> av_q2d()'d into an AVRational.
> 
> I'd still not remove it, as Paul said. It's harmless being there and in the 
> future it could be used.

The field itself is harmless, but it makes big confusing. It takes me some 
efforts to figure out a rational type must use dbl to hold default value.

For backward compatibility, I don’t think it’s easy to switch to AVRational 
from dbl.

If we decide to keep it, I can add a comment to reduce the confusion.

> 
>> /Tomas
>> _______________________________________________
>> 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".
> _______________________________________________
> 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 sub

_______________________________________________
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