From a4b6bf8c41b54554286117b97e78412a32b5147f Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 2 Mar 2015 19:09:36 +0100 Subject: player: refine rar:// playlist-safety handling It was possible to make the player play local files by putting rar:// links into remote playlists, and some other potentially unsafe things. Redo the handling of it. Now the rar-redirector (the thing in demux_playlist.c) sets disable_safety, which makes the player open any playlist entries returned. This is fine, because it redirects to the same file anyway (just with different selection/interpretation of the contents). On the other hand, rar:// itself is now considered fully unsafe, which means that it is ignored if found in normal playlists. --- player/loadfile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/loadfile.c b/player/loadfile.c index 36d0e4e786..5e78ed430c 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1112,10 +1112,13 @@ goto_reopen_demuxer: ; load_timeline(mpctx); if (mpctx->demuxer->playlist) { - int entry_stream_flags = - (mpctx->demuxer->stream->safe_origin ? 0 : STREAM_SAFE_ONLY) | - (mpctx->demuxer->stream->is_network ? STREAM_NETWORK_ONLY : 0); struct playlist *pl = mpctx->demuxer->playlist; + int entry_stream_flags = 0; + if (!pl->disable_safety) { + entry_stream_flags = STREAM_SAFE_ONLY; + if (mpctx->demuxer->stream->is_network) + entry_stream_flags |= STREAM_NETWORK_ONLY; + } for (struct playlist_entry *e = pl->first; e; e = e->next) e->stream_flags |= entry_stream_flags; transfer_playlist(mpctx, pl); -- cgit v1.2.3