[FFmpeg-devel] [PATCH] do not check protocol on hls without network.

2021-10-02 Thread ekibun
Hi. I'm investigating in custom IO for HLS playing, and got errors while 
calling segments.
I've compiled libav with `--disable-network` configure and tried custom IO by 
overriding `io_open` and `io_close` for `AVFormatContext`. Everything goes well 
until open segments urls.
In the function `open_url` of `hls.c`, demuxer checks the protocol name before 
calling io_open.
The protocol name is obtained by `avio_find_protocol_name` that always return 
`NULL` since no network protocol exists.
And after I commented out all the protocol checks in `hls.c`, it functions 
properly.
Curious to hear if you think it's a good solution or is there a better way 
around.
Thanks!

---
 libavformat/hls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 9fd4ad9f32..e139922ab8 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -631,6 +631,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, 
const char *url,
 int ret;
 int is_http = 0;
 
+#if CONFIG_HTTP_PROTOCOL
 if (av_strstart(url, "crypto", NULL)) {
 if (url[6] == '+' || url[6] == ':')
 proto_name = avio_find_protocol_name(url + 7);
@@ -669,6 +670,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, 
const char *url,
 ;
 else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
 return AVERROR_INVALIDDATA;
+#endif
 
 av_dict_copy(&tmp, *opts, 0);
 av_dict_copy(&tmp, opts2, 0);
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] (no subject)

2021-10-21 Thread ekibun
Hi. I'm investigating in custom IO for HLS playing, and got errors while 
calling segments.
I've compiled libav with `--disable-network` configure and tried custom IO by 
overriding `io_open` and `io_close` for `AVFormatContext`. Everything goes well 
until open segments urls.
In the function `open_url` of `hls.c`, demuxer checks the protocol name before 
calling io_open.
The protocol name is obtained by `avio_find_protocol_name` that always return 
`NULL` since no network protocol exists.
And after I commented out all the protocol checks in `hls.c`, it functions 
properly.
Curious to hear if you think it's a good solution or is there a better way 
around.
Thanks! 


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avformat/hls: Do not check protocol on hls without network.

2021-10-21 Thread ekibun
---
 libavformat/hls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 52a031ed..55fa831b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -637,6 +637,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, 
const char *url,
 int ret;
 int is_http = 0;
 
+#if CONFIG_HTTP_PROTOCOL
 if (av_strstart(url, "crypto", NULL)) {
 if (url[6] == '+' || url[6] == ':')
 proto_name = avio_find_protocol_name(url + 7);
@@ -675,6 +676,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, 
const char *url,
 ;
 else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
 return AVERROR_INVALIDDATA;
+#endif
 
 av_dict_copy(&tmp, *opts, 0);
 av_dict_copy(&tmp, opts2, 0);
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".