1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00
mpv/stream
wm4 987146362e lua: add an utility function for starting processes
Because 1) Lua is terrible, and 2) popen() is terrible. Unfortunately,
since Unix is also terrible, this turned out more complicated than I
hoped. As a consequence and to avoid that this code has to be maintained
forever, add a disclaimer that any function in Lua's utils module can
disappear any time. The complexity seems a bit ridiculous, especially
for a feature so far removed from actual video playback, so if it turns
out that we don't really need this function, it will be dropped again.

The motivation for this commit is the same as with 8e4fa5fc.

Note that there is an "#ifndef __GLIBC__". The GNU people are very
special people and thought it'd be convenient to actually declare
"environ", even though the POSIX people, which are also very special
people, state that no header declares this and that the user has to
declare this manually. Since the GNU people overtook the Unix world with
their very clever "embrace, extend, extinguish" strategy, but not 100%,
and trying to build without _GNU_SOURCE is hopeless; but since there
might be Unix environments which support _GNU_SOURCE features partially,
this means that in practice "environ" will be randomly declared or not
declared by system headers. Also, gcc was written by very clever people
too, and prints a warning if an external variable is declared twice (I
didn't check, but I suppose redeclaring is legal C, and not even the gcc
people are clever enough to only warn against a definitely not legal C
construct, although sometimes they do this), ...and since we at mpv hate
compiler warnings, we seek to silence them all. Adding a configure test
just for a warning seems too radical, so we special-case this against
__GLIBC__, which is hopefully not defined on other libcs, especially not
libcs which don't implement all aspects of _GNU_SOURCE, and redefine
"environ" on systems even if the headers define it already (because they
support _GNU_SOURCE - as I mentioned before, the clever GNU people wrote
software THAT portable that other libcs just gave up and implemented
parts of _GNU_SOURCE, although probably not all), which means that
compiling mpv will print a warning about "environ" being redefined, but
at least this won't happen on my system, so all is fine. However, should
someone complain about this warning, I will force whoever complained
about this warning to read this ENTIRE commit message, and if possible,
will also force them to eat a printed-out copy of the GNU Manifesto, and
if that is not enough, maybe this person could even be forced to
convince the very clever POSIX people of not doing crap like this:
having the user to manually declare somewhat central symbols - but I
doubt it's possible, because the POSIX people are too far gone and only
care about maintaining compatibility with old versions of AIX and HP-UX.

Oh, also, this code contains some subtle and obvious issues, but writing
about this is not fun.
2014-10-19 05:51:37 +02:00
..
resolve quvi: add option to not fetch subtitles 2014-01-05 23:07:34 +01:00
ai_alsa1x.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
ai_oss.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
ai_sndio.c audio: drop swapped-endian audio formats 2014-09-23 23:09:25 +02:00
audio_in.c Kill all tabs 2014-04-13 18:03:01 +02: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 stream: redo playback abort handling 2014-09-13 16:09:51 +02: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 stream: redo playback abort handling 2014-09-13 16:09:51 +02: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 stream_dvd: better .ifo probing 2014-09-25 23:54:18 +02: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 stream_dvd: better .ifo probing 2014-09-25 23:54:18 +02:00
stream_lavf.c demux_lavf: set stream network options if applicable 2014-10-14 21:01:30 +02: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 build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02: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 lua: add an utility function for starting processes 2014-10-19 05:51:37 +02:00
stream.h lua: add an utility function for starting processes 2014-10-19 05:51:37 +02: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 stream: change malloc+memset to calloc 2014-09-27 16:01:49 +02:00