Message ID | TY2PR03MB363271E351DAEE974FC65C05A3140@TY2PR03MB3632.apcprd03.prod.outlook.com |
---|---|
State | Superseded |
Headers | show |
On Thu, Sep 27, 2018 at 11:01:15AM +0000, He Lei wrote: > The URLContext of the aviocontext is null when custom IO is used, If keepalive, that will cause the assertion to fail > > 592 static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb, > 593 const char *url) > 594 { > 595 #if !CONFIG_HTTP_PROTOCOL > 596 return AVERROR_PROTOCOL_NOT_FOUND; > 597 #else > 598 int ret; > 599 URLContext *uc = ffio_geturlcontext(*pb); > 600 av_assert0(uc); > 601 (*pb)->eof_reached = 0; > 602 ret = ff_http_do_new_request(uc, url); > 603 if (ret < 0) { > 604 ff_format_io_close(s, pb); > 605 } > 606 return ret; > 607 #endif > 608 } > > LeiHe > helei0908@hotmail.com<mailto:helei0908@hotmail.com> > > > > 在 2018年9月26日,下午6:43,Lei He <helei0908@hotmail.com<mailto:helei0908@hotmail.com>> 写道: > > Signed-off-by: Lei He <helei0908@hotmail.com<mailto:helei0908@hotmail.com>> > --- > libavformat/hls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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; Applying: avformat/hls.c:If custom IO is used, Don`t keepalive. error: corrupt patch at line 12 error: could not build fake ancestor Patch failed at 0001 avformat/hls.c:If custom IO is used, Don`t keepalive. [...]
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;
The URLContext of the aviocontext is null when custom IO is used, If keepalive, that will cause the assertion to fail 592 static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb, 593 const char *url) 594 { 595 #if !CONFIG_HTTP_PROTOCOL 596 return AVERROR_PROTOCOL_NOT_FOUND; 597 #else 598 int ret; 599 URLContext *uc = ffio_geturlcontext(*pb); 600 av_assert0(uc); 601 (*pb)->eof_reached = 0; 602 ret = ff_http_do_new_request(uc, url); 603 if (ret < 0) { 604 ff_format_io_close(s, pb); 605 } 606 return ret; 607 #endif 608 } LeiHe helei0908@hotmail.com<mailto:helei0908@hotmail.com> 在 2018年9月26日,下午6:43,Lei He <helei0908@hotmail.com<mailto:helei0908@hotmail.com>> 写道: Signed-off-by: Lei He <helei0908@hotmail.com<mailto:helei0908@hotmail.com>> --- libavformat/hls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 (Apple Git-112)