1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 21:31:52 +00:00
mpv/player
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
..
lua osc: update cache display 2014-09-25 11:57:49 +02:00
timeline matroska: look for all known matroska file extensions 2014-10-06 22:33:21 +02:00
audio.c audio: don't go to sleep after audio reinit 2014-10-17 01:10:49 +02:00
client.c command: add a mechanism to allow scripts to intercept file loads 2014-10-16 01:00:22 +02:00
client.h lua: synchronously wait until scripts are loaded 2014-09-06 17:02:47 +02:00
command.c command: add "estimated-vf-fps" change notifcation 2014-10-19 05:51:37 +02:00
command.h command: add a mechanism to allow scripts to intercept file loads 2014-10-16 01:00:22 +02:00
configfiles.c options: don't load per-file config files by default 2014-10-17 02:55:31 +02:00
core.h input: implement JSON-based IPC protocol 2014-10-17 20:46:31 +02:00
discnav.c player: open stream and demuxer asynchronously 2014-10-06 21:49:26 +02:00
loadfile.c player: free subtitle renderer on exit 2014-10-16 01:01:27 +02:00
lua.c lua: add an utility function for starting processes 2014-10-19 05:51:37 +02:00
main_fn.c cocoa: fix build by using the correct HAVE_* macro 2014-08-06 09:31:59 +02:00
main.c input: implement JSON-based IPC protocol 2014-10-17 20:46:31 +02:00
misc.c player: open stream and demuxer asynchronously 2014-10-06 21:49:26 +02:00
osd.c player: fix OSD cycling 2014-10-14 19:20:36 +02:00
playloop.c player: fix --frames 2014-10-14 13:29:38 +02:00
screenshot.c Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
screenshot.h
scripting.c win32: get rid of mp_stat in the normal source code 2014-10-17 22:15:19 +02:00
sub.c player: move some libass setup code to sub.c 2014-10-03 23:10:18 +02:00
video.c player: fix --frames 2014-10-14 13:29:38 +02:00