[FFmpeg-devel] Allow Data URI scheme for hls

Submitted by fairytale on Feb. 6, 2017, 5:57 a.m.

Details

Message ID f18e250b-3ffd-4b66-8042-d25da05053ef@XIN-K.local
State New
Headers show

Commit Message

fairytale Feb. 6, 2017, 5:57 a.m.
#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(-)

Patch hide | download patch | download mbox

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)] == ':')
         ;