[FFmpeg-devel] [PATCH v4 5/5] libavfilter: VAAPI surface converter

wm4 nfxjfg at googlemail.com
Sun Jan 24 14:14:30 CET 2016


On Sun, 24 Jan 2016 13:12:44 +0000
Mark Thompson <sw at jkqxz.net> wrote:

> On 24/01/16 00:21, Timothy Gu wrote:
> > On Sat, Jan 23, 2016 at 07:17:00PM +0000, Mark Thompson wrote:  
> >> +    err = ...(...);
> >> +    if(err) {  
> > 
> > err < 0?
> >   
> 
> Is there a policy on this?
> 
> For functions with only zero success or error code, I would prefer to check for nonzero as error.  It will catch any strange cases, including raising an error if the underlying API changes to have more different success cases that you need to modify the code to handle.

Almost all functions in ffmpeg that return error codes return <0 on
error, and >=0 on success. It would thus be advisable to follow this
convention.


More information about the ffmpeg-devel mailing list