mpv/input
wm4 1cb9e7efb8 stream, demux: redo origin policy thing
mpv has a very weak and very annoying policy that determines whether a
playlist should be used or not. For example, if you play a remote
playlist, you usually don't want it to be able to read local filesystem
entries. (Although for a media player the impact is small I guess.)

It's weak and annoying as in that it does not prevent certain cases
which could be interpreted as bad in some cases, such as allowing
playlists on the local filesystem to reference remote URLs. It probably
barely makes sense, but we just want to exclude some other "definitely
not a good idea" things, all while playlists generally just work, so
whatever.

The policy is:
- from the command line anything is played
- local playlists can reference anything except "unsafe" streams
  ("unsafe" means special stream inputs like libavfilter graphs)
- remote playlists can reference only remote URLs
- things like "memory://" and archives are "transparent" to this

This commit does... something. It replaces the weird stream flags with a
slightly clearer "origin" value, which is now consequently passed down
and used everywhere. It fixes some deviations from the described policy.

I wanted to force archives to reference only content within them, but
this would probably have been more complicated (or required different
abstractions), and I'm too lazy to figure it out, so archives are now
"transparent" (playlists within archives behave the same outside).

There may be a lot of bugs in this.

This is unfortunately a very noisy commit because:
- every stream open call now needs to pass the origin
- so does every demuxer open call (=> params param. gets mandatory)
- most stream were changed to provide the "origin" value
- the origin value needed to be passed along in a lot of places
- I was too lazy to split the commit

Fixes: #7274
2019-12-20 13:00:39 +01:00
..
cmd.c input: export input.conf comments ot input-bindings property 2019-11-23 01:18:49 +01:00
cmd.h command: reduce OSC/stats log spam 2019-12-19 12:52:13 +01:00
event.c input: ignore empty lines on drag-drop mime data 2019-09-21 15:39:47 +02:00
event.h input/event.h: add include guard 2016-03-15 22:44:15 +01:00
input.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
input.h command, input: add input-bindings property 2019-11-23 01:18:49 +01:00
ipc-dummy.c build: change how some OS specific source files are selected 2017-06-29 10:30:16 +02:00
ipc-unix.c options: get rid of GLOBAL_CONFIG hack 2019-11-29 12:14:43 +01:00
ipc-win.c options: get rid of GLOBAL_CONFIG hack 2019-11-29 12:14:43 +01:00
ipc.c ipc: cosmetic: switch a negated if/else 2018-05-25 10:46:18 +02:00
keycodes.c mac: remove Apple Remote support 2019-12-15 20:07:31 +01:00
keycodes.h mac: remove Apple Remote support 2019-12-15 20:07:31 +01:00
pipe-win32.c osdep: rename atomics.h to atomic.h 2016-09-07 11:26:25 +02:00
sdl_gamepad.c sdl: prevent concurrent use of SDL in different threads 2019-10-25 22:17:54 +02:00