[FFmpeg-devel] [PATCH 2/3] avutil/opt: Add AV_OPT_TYPE_UINT64

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Nov 22 01:29:02 EET 2016


On 20.11.2016 21:52, Michael Niedermayer wrote:
> On Sun, Nov 20, 2016 at 08:55:44PM +0100, Andreas Cadhalpun wrote:
>> On 20.11.2016 12:57, Michael Niedermayer wrote:
>>> +        if (intnum == 1 && d == (double)UINT64_MAX) {
>>> +            *(int64_t *)dst = UINT64_MAX;
>>
>> Is there a reason why this uses int64_t, 
>>
>>> +        } else if (o->max > INT64_MAX + 1ULL && d > INT64_MAX + 1ULL) {
>>> +            *(uint64_t *)dst = (llrint(d - (INT64_MAX + 1ULL)) + (INT64_MAX + 1ULL))*intnum;
>>
>> but this uint64_t,
>>
>>> +        } else {
>>> +            *(int64_t *)dst = llrint(d) * intnum;
>>
>> and this again int64_t?
> 
> these are left over from the year old patch this is based on
> fixed locally

OK. Now I've another question. Why does the check involve o->max?
Is the out-of-range check at the beginning of write_number not
sufficient?

Best regards,
Andreas


More information about the ffmpeg-devel mailing list