Message ID | 1563027777-17411-1-git-send-email-lance.lmwang@gmail.com |
---|---|
State | New |
Headers | show |
ping, have test with the example code. On Sat, Jul 13, 2019 at 10:22:57PM +0800, lance.lmwang@gmail.com wrote: > From: Limin Wang <lance.lmwang@gmail.com> > > By the code, is_connected is used to check file open or not, so after open_dir > is done, we should not set is_connected to 1, it'll cause the function ffurl_closep > will invoke the url_close and cause unexpected file close. > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > --- > libavformat/avio.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/libavformat/avio.c b/libavformat/avio.c > index 663789e..8b52aa3 100644 > --- a/libavformat/avio.c > +++ b/libavformat/avio.c > @@ -560,7 +560,6 @@ int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options) > if (ret < 0) > goto fail; > > - h->is_connected = 1; > ctx->url_context = h; > *s = ctx; > return 0; > -- > 2.6.4 >
diff --git a/libavformat/avio.c b/libavformat/avio.c index 663789e..8b52aa3 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -560,7 +560,6 @@ int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options) if (ret < 0) goto fail; - h->is_connected = 1; ctx->url_context = h; *s = ctx; return 0;