diff mbox

[FFmpeg-devel] avformat/hls.c:If custom IO is used, Don`t keepalive.

Message ID TY2PR03MB3632495B655385E73D34CBAEA3EC0@TY2PR03MB3632.apcprd03.prod.outlook.com
State New
Headers show

Commit Message

He Lei Sept. 28, 2018, 9:52 a.m. UTC
Because, the URLContext of the aviocontext is null when custom IO is used,
If  keepalive, that will cause the assertion to fail.

Signed-off-by: Lei He <helei0908@hotmail.com>
---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8ad08baaed..b7a11939bc 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -651,7 +651,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;
 
-    if (is_http && c->http_persistent && *pb) {
+    if (!(s->flags & AVFMT_FLAG_CUSTOM_IO) && is_http && c->http_persistent && *pb) {
         ret = open_url_keepalive(c->ctx, pb, url);
         if (ret == AVERROR_EXIT) {
             return ret;