[FFmpeg-devel] [PATCH] wav: Add check for 'fmt' tag

Nicolas George nicolas.george at normalesup.org
Wed Jul 18 20:01:05 CEST 2012

Le primidi 1er thermidor, an CCXX, Derek Buitenhuis a écrit :
> Is there any reason we prefer an assert over a proper error?

An error is for a situation that can happen due to external circumstances,
even very unlikely ones: out of memory, corrupted file, etc.

An assert is for a situation where you are pretty sure something is true,
and you are absolutely sue it should be true, and you want to rely on it in
the following code, but since the code that lead there is quite complex, you
are not 100% sure it will actually be true. If, per chance, there is a bug
and the assert fail, you will get an accurate error message (whereas calling
code could just ignore the error), and even a backtrace or a core dump.

AVERROR_BUG is for intermediate cases.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120718/b95a8dcd/attachment.asc>

More information about the ffmpeg-devel mailing list