[FFmpeg-devel] [PATCH] Allow Data URI scheme for hls

fairytale fairytale at ftlabs.org
Mon Feb 6 07:57:25 EET 2017


#EXT-X-KEY:METHOD=AES-128,URI="data:text/plain;charset=utf-8,abcdefgh12345678",IV=0xffffffffffffffffffffffffffffffff
video-js support this and as ffurl_connect support data uri, just allow it.
---
 libavformat/hls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 3ae3c7cc5c..77917f0e44 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -617,8 +617,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
     if (!proto_name)
         return AVERROR_INVALIDDATA;
 
-    // only http(s) & file are allowed
-    if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL))
+    // only http(s) & file & data are allowed
+    if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL) && !av_strstart(proto_name, "data", NULL))
         return AVERROR_INVALIDDATA;
     if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
         ;
-- 
2.11.0.windows.1




More information about the ffmpeg-devel mailing list