[vlc-devel] commit: lpcm: abort() is a better solution here (Jean-Baptiste Kempf )

Rémi Denis-Courmont remi at remlab.net
Wed Dec 16 15:07:51 CET 2009

On Wed, 16 Dec 2009 14:52:56 +0100, Jean-Paul Saman <jpsaman at gmail.com>

>> No, it's much worse. assert() prints a diagnostic message with a source
>> code file name, a line number and the assertion. abort() just terminates
>> the process. Thus cannot be traced unless core dumping is enabled or a
>> debugger is running, neither of which are normally true.

> I dislike both solutions although assert() is preferred above abort().

> In case a stream with LPCM is started in a VLM and other streams are
> already running, then both assert() and abort() will kill the entire
> process and thereby disrupting service. In this case I prefer
> gracefull degredation and the startup of that one stream with LPCM
> should just fail.

assert() is meant to document assertion and detect bugs. abort() is meant
to 'handle' non-recoverable errors, or for custom assert-like functions.

Certainly, invalid input is not a bug in the code nor a non-recoverable
error. If that is the case, I can only agree that both assert() and abort()
are just plain wrong.

Rémi Denis-Courmont

More information about the vlc-devel mailing list