1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 14:22:17 +00:00
mpv/stream
wm4 cc54377463 Do not call strerror()
...because everything is terrible.

strerror() is not documented as having to be thread-safe by POSIX and
C11. (Which is pretty much bullshit, because both mandate threads and
some form of thread-local storage - so there's no excuse why
implementation couldn't implement this in a thread-safe way. Especially
with C11 this is ridiculous, because there is no way to use threads and
convert error numbers to strings at the same time!)

Since we heavily use threads now, we should avoid unsafe functions like
strerror().

strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and
gives the function different semantics than the POSIX one. It's a bit of
work to convince this piece of shit to expose the POSIX standard
function, and not the messed up GNU one.

strerror_l() is also in POSIX, but only since the 2008 standard, and
thus is not widespread.

The solution is using avlibc (libavutil, by its official name), which
handles the unportable details for us, mostly. We avoid some pain.
2014-11-26 21:21:56 +01:00
..
ai_alsa1x.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
ai_oss.c Do not call strerror() 2014-11-26 21:21:56 +01:00
ai_sndio.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
audio_in.c Do not call strerror() 2014-11-26 21:21:56 +01:00
audio_in.h demux: mp_msg conversions 2013-12-21 21:43:16 +01:00
cache_file.c cache_file: refuse to cache unseekable streams 2014-09-29 18:06:44 +02:00
cache.c Do not call strerror() 2014-11-26 21:21:56 +01:00
cookies.c Kill all tabs 2014-04-13 18:03:01 +02:00
cookies.h options: move network related options to MPOpts 2013-12-22 13:11:22 +01:00
discnav.h player: rename dvdnav to discnav 2014-03-30 11:42:49 +09:00
dvb_tune.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
dvb_tune.h stream: mp_msg conversions 2013-12-21 21:43:16 +01:00
dvbin.h stream_dvb: restore --dvbin-file option 2014-08-06 20:30:48 +02:00
frequencies.c stream_pvr: remove global option variables 2014-06-11 00:34:42 +02:00
frequencies.h stream_pvr: remove global option variables 2014-06-11 00:34:42 +02:00
rar.c Remove some unneeded NULL checks 2014-11-21 09:58:09 +01:00
rar.h stream: redo playback abort handling 2014-09-13 16:09:51 +02:00
stream_avdevice.c Add more const 2014-06-11 00:39:14 +02:00
stream_bluray.c stream_bluray: autodetect AVCHD directories 2014-09-27 18:33:36 +02:00
stream_cdda.c stream: change malloc+memset to calloc 2014-09-27 16:01:49 +02:00
stream_dvb.c stream_dvb: use stream_drop_buffers() 2014-10-08 00:52:39 +02:00
stream_dvd_common.c stream_dvd: better .ifo probing 2014-09-25 23:54:18 +02:00
stream_dvd_common.h stream_dvd: better .ifo probing 2014-09-25 23:54:18 +02:00
stream_dvd.c Do not call strerror() 2014-11-26 21:21:56 +01:00
stream_dvdnav.c stream_dvdnav: allow opening DVD directories directly 2014-09-26 00:30:21 +02:00
stream_edl.c Add more const 2014-06-11 00:39:14 +02:00
stream_file.c Do not call strerror() 2014-11-26 21:21:56 +01:00
stream_lavf.c demux_lavf, stream_lavf: drop local buffers on time-seeks 2014-10-30 22:50:44 +01:00
stream_memory.c Add more const 2014-06-11 00:39:14 +02:00
stream_mf.c Add more const 2014-06-11 00:39:14 +02:00
stream_null.c Add more const 2014-06-11 00:39:14 +02:00
stream_pvr.c Do not call strerror() 2014-11-26 21:21:56 +01:00
stream_rar.c stream: redo playback abort handling 2014-09-13 16:09:51 +02:00
stream_smb.c Add more const 2014-06-11 00:39:14 +02:00
stream_tv.c Add more const 2014-06-11 00:39:14 +02:00
stream.c Do not call strerror() 2014-11-26 21:21:56 +01:00
stream.h stream: reduce ifdeffery for win32 somewhat 2014-11-18 13:40:34 +01:00
tv.c tv: initialize frequencies to 0 2014-08-28 12:02:50 +02:00
tv.h tv: move demuxer parts to separate file 2014-07-05 17:07:15 +02:00
tvi_def.h Kill all tabs 2014-04-13 18:03:01 +02:00
tvi_dummy.c tv: remove printing of useless comment information 2014-06-11 00:34:42 +02:00
tvi_v4l2.c Do not call strerror() 2014-11-26 21:21:56 +01:00