On Fri, 21 Mar 2014 10:53:45 +0100, Tim Walker <[email protected]>
wrote:
> On 20 Mar 2014, at 18:03, Rémi Denis-Courmont <[email protected]> wrote:
> 
>> +int av_vdpau_get_level(AVCodecContext *avctx, unsigned *levelp)
>> +{
>> +    unsigned level = avctx->level;
>> +
>> +    if (level == FF_LEVEL_UNKNOWN)
>> +        return AVERROR(EINVAL);
> 
> FWIW, AVCodecContext.level is signed, and FF_LEVEL_UNKNOWN is negative
> (-99).

The code still works, since the compiler will convert both the variable
and the constant to unsigned before the comparison. Do you want an explicit
cast?
VDPAU levels are unsigned, so the sign conversion has to be done
*somewhere*.

-- 
Rémi Denis-Courmont
Sent from my collocated server
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to