mpv/options
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
..
m_config.c m_config: remove change callback before unintialization 2019-11-30 17:33:29 +01:00
m_config.h player: change m_config to use new option handling mechanisms 2019-11-29 12:49:15 +01:00
m_option.c options: fix incorrect deprecation message 2019-12-19 01:17:01 +01:00
m_option.h options: fix filter list comparison (again) 2019-12-18 06:49:48 +01:00
m_property.c command: move property multiply code to m_property.c 2018-03-26 19:47:08 +02:00
m_property.h command: move property multiply code to m_property.c 2018-03-26 19:47:08 +02:00
options.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
options.h stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
parse_commandline.c Remove optical disc fancification layers 2019-09-13 17:31:59 +02:00
parse_commandline.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
parse_configfile.c
parse_configfile.h
path.c options/path: fix url detection per RFC3986 2019-04-05 20:48:24 +03:00
path.h path: don't access global option struct 2018-05-24 19:56:35 +02:00