1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 15:22:09 +00:00
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.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
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
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
sdl_gamepad.c sdl: prevent concurrent use of SDL in different threads 2019-10-25 22:17:54 +02:00