On 26/07/13 16:07, wm4 wrote: > On Fri, 26 Jul 2013 15:46:11 +0200 > Rémi Denis-Courmont <[email protected]> wrote: > >> On Fri, 26 Jul 2013 15:33:10 +0200, wm4 <[email protected]> wrote: >>> On Fri, 26 Jul 2013 11:36:47 +0200 >>> Luca Barbato <[email protected]> wrote: >>> > >>> What is _really_ ugly is that av_strerror needs a buffer, instead of >>> returning a static string. >> >> If it calls the system strerror_r(), then it is unavoidable. Note, by the >> way, that while it may be tempting to assume that strerror() returns static >> strings, it does not. Notably on GNU/Linux, the implementation of >> strerror() is not thread-safe; I have seen it crash on reentry. > > It's a bit strange that a libav error code can be a libc error code in > the first place.
I'm afraid you aren't considering how the error handling exactly works. You have to forward the errors from the source up to the user. When you are using a libavdevice you might get quite os-specific errors forwarded, when you are sending some packet using a network protocol, the network specific errors get forwarded and so on and so forth. On top of this you have our application specific errors to signal what went wrong on our side. So, since strerror_r is what you should use in a library we had to model av_strerror to match it since it's what we are using. lu _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
