summaryrefslogtreecommitdiffstats
path: root/stream/stream_lavf.c
diff options
context:
space:
mode:
authorAlby <alberto@mattea.info>2023-01-02 22:53:53 +0100
committerLeo Izen <leo.izen@gmail.com>2023-01-31 12:03:41 -0500
commit88918411f3533e75df0ddce2cdeb25ce55804589 (patch)
tree0947c30ec50d3b469c605cd93e92a36c898e9d05 /stream/stream_lavf.c
parente4e3a8fc0bfca61dd5600bd1df13f59356a1a4e2 (diff)
downloadmpv-88918411f3533e75df0ddce2cdeb25ce55804589.tar.bz2
mpv-88918411f3533e75df0ddce2cdeb25ce55804589.tar.xz
stream: accept webdav:// and webdavs:// urls
Treat them as http:// and https:// respectively. This allows to play files on webdav archives directly on KDE, avoiding the (extremely slow) local copying performed by kio.
Diffstat (limited to 'stream/stream_lavf.c')
-rw-r--r--stream/stream_lavf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c
index 050bf2c52d..0886ef8a61 100644
--- a/stream/stream_lavf.c
+++ b/stream/stream_lavf.c
@@ -285,11 +285,18 @@ static int open_f(stream_t *stream)
}
// Replace "mms://" with "mmsh://", so that most mms:// URLs just work.
+ // Replace "webdav://" with "http://" and "webdavs://" with "https://"
bstr b_filename = bstr0(filename);
if (bstr_eatstart0(&b_filename, "mms://") ||
bstr_eatstart0(&b_filename, "mmshttp://"))
{
filename = talloc_asprintf(temp, "mmsh://%.*s", BSTR_P(b_filename));
+ } else if (bstr_eatstart0(&b_filename, "webdav://"))
+ {
+ filename = talloc_asprintf(temp, "http://%.*s", BSTR_P(b_filename));
+ } else if (bstr_eatstart0(&b_filename, "webdavs://"))
+ {
+ filename = talloc_asprintf(temp, "https://%.*s", BSTR_P(b_filename));
}
av_dict_set(&dict, "reconnect", "1", 0);
@@ -411,7 +418,8 @@ const stream_info_t stream_info_ffmpeg = {
.protocols = (const char *const[]){
"rtmp", "rtsp", "rtsps", "http", "https", "mms", "mmst", "mmsh", "mmshttp",
"rtp", "httpproxy", "rtmpe", "rtmps", "rtmpt", "rtmpte", "rtmpts", "srt",
- "rist", "srtp", "gopher", "gophers", "data", "ipfs", "ipns",
+ "rist", "srtp", "gopher", "gophers", "data", "ipfs", "ipns", "webdav",
+ "webdavs",
NULL },
.can_write = true,
.stream_origin = STREAM_ORIGIN_NET,