mpv/common
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
..
av_common.c demux: use no overlapping packets for lossless audio 2019-09-19 20:37:04 +02:00
av_common.h demux: use no overlapping packets for lossless audio 2019-09-19 20:37:04 +02:00
av_log.c player: accept compatible later FFmpeg library runtime versions 2019-10-11 21:28:04 +02:00
av_log.h
codecs.c codecs: remove unused family field 2018-02-01 10:21:55 +01:00
codecs.h codecs: remove unused family field 2018-02-01 10:21:55 +01:00
common.c common: add a helper to round up to next power of 2 2019-11-06 21:35:49 +01:00
common.h common: add a helper to round up to next power of 2 2019-11-06 21:35:49 +01:00
encode.h encode: get rid of the output packet queue 2018-05-03 01:08:44 +03:00
encode_lavc.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
encode_lavc.h encode: get rid of the output packet queue 2018-05-03 01:08:44 +03:00
global.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
msg.c msg: fix "terminal-default" logging mode 2019-12-16 21:31:54 +01:00
msg.h msg: try to document purpose of log levels better 2019-11-07 22:53:13 +01:00
msg_control.h player: remove mechanisms for better logging with repl.lua 2019-11-18 00:44:54 +01:00
playlist.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
playlist.h stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
recorder.c recorder: don't use a magic index for mp_recorder_get_sink() 2019-09-29 01:41:19 +02:00
recorder.h recorder: don't use a magic index for mp_recorder_get_sink() 2019-09-29 01:41:19 +02:00
tags.c demux: support for some kinds of timed metadata 2018-04-18 01:17:42 +03:00
tags.h demux: support for some kinds of timed metadata 2018-04-18 01:17:42 +03:00
version.c build: move copyright statement to a shared location 2018-01-01 21:05:09 +00:00