Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e52a9145
Commit
e52a9145
authored
Mar 31, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: make url_close() internal.
parent
58a48c65
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
46 additions
and
41 deletions
+46
-41
applehttpproto.c
libavformat/applehttpproto.c
+2
-2
avio.c
libavformat/avio.c
+8
-4
avio.h
libavformat/avio.h
+1
-9
aviobuf.c
libavformat/aviobuf.c
+2
-2
concat.c
libavformat/concat.c
+2
-2
gopher.c
libavformat/gopher.c
+1
-1
http.c
libavformat/http.c
+5
-5
md5proto.c
libavformat/md5proto.c
+1
-1
mmsh.c
libavformat/mmsh.c
+2
-2
mmst.c
libavformat/mmst.c
+1
-1
rtmpproto.c
libavformat/rtmpproto.c
+1
-1
rtpproto.c
libavformat/rtpproto.c
+4
-4
rtsp.c
libavformat/rtsp.c
+5
-5
sapdec.c
libavformat/sapdec.c
+1
-1
sapenc.c
libavformat/sapenc.c
+1
-1
url.h
libavformat/url.h
+9
-0
No files found.
libavformat/applehttpproto.c
View file @
e52a9145
...
@@ -246,7 +246,7 @@ start:
...
@@ -246,7 +246,7 @@ start:
return
ret
;
return
ret
;
}
}
if
(
s
->
seg_hd
)
{
if
(
s
->
seg_hd
)
{
url_close
(
s
->
seg_hd
);
ff
url_close
(
s
->
seg_hd
);
s
->
seg_hd
=
NULL
;
s
->
seg_hd
=
NULL
;
s
->
cur_seq_no
++
;
s
->
cur_seq_no
++
;
}
}
...
@@ -292,7 +292,7 @@ static int applehttp_close(URLContext *h)
...
@@ -292,7 +292,7 @@ static int applehttp_close(URLContext *h)
free_segment_list
(
s
);
free_segment_list
(
s
);
free_variant_list
(
s
);
free_variant_list
(
s
);
url_close
(
s
->
seg_hd
);
ff
url_close
(
s
->
seg_hd
);
av_free
(
s
);
av_free
(
s
);
return
0
;
return
0
;
}
}
...
...
libavformat/avio.c
View file @
e52a9145
...
@@ -164,7 +164,7 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
...
@@ -164,7 +164,7 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
0
;
fail:
fail:
url_close
(
*
puc
);
ff
url_close
(
*
puc
);
*
puc
=
NULL
;
*
puc
=
NULL
;
return
ret
;
return
ret
;
}
}
...
@@ -196,6 +196,10 @@ int64_t url_seek(URLContext *h, int64_t pos, int whence)
...
@@ -196,6 +196,10 @@ int64_t url_seek(URLContext *h, int64_t pos, int whence)
{
{
return
ffurl_seek
(
h
,
pos
,
whence
);
return
ffurl_seek
(
h
,
pos
,
whence
);
}
}
int
url_close
(
URLContext
*
h
)
{
return
ffurl_close
(
h
);
}
#endif
#endif
#define URL_SCHEME_CHARS \
#define URL_SCHEME_CHARS \
...
@@ -239,7 +243,7 @@ int ffurl_open(URLContext **puc, const char *filename, int flags)
...
@@ -239,7 +243,7 @@ int ffurl_open(URLContext **puc, const char *filename, int flags)
ret
=
ffurl_connect
(
*
puc
);
ret
=
ffurl_connect
(
*
puc
);
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
0
;
url_close
(
*
puc
);
ff
url_close
(
*
puc
);
*
puc
=
NULL
;
*
puc
=
NULL
;
return
ret
;
return
ret
;
}
}
...
@@ -309,7 +313,7 @@ int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
...
@@ -309,7 +313,7 @@ int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
return
ret
;
return
ret
;
}
}
int
url_close
(
URLContext
*
h
)
int
ff
url_close
(
URLContext
*
h
)
{
{
int
ret
=
0
;
int
ret
=
0
;
if
(
!
h
)
return
0
;
/* can happen when ffurl_open fails */
if
(
!
h
)
return
0
;
/* can happen when ffurl_open fails */
...
@@ -330,7 +334,7 @@ int url_exist(const char *filename)
...
@@ -330,7 +334,7 @@ int url_exist(const char *filename)
URLContext
*
h
;
URLContext
*
h
;
if
(
ffurl_open
(
&
h
,
filename
,
URL_RDONLY
)
<
0
)
if
(
ffurl_open
(
&
h
,
filename
,
URL_RDONLY
)
<
0
)
return
0
;
return
0
;
url_close
(
h
);
ff
url_close
(
h
);
return
1
;
return
1
;
}
}
...
...
libavformat/avio.h
View file @
e52a9145
...
@@ -109,17 +109,9 @@ attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size);
...
@@ -109,17 +109,9 @@ attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size);
attribute_deprecated
int
url_read_complete
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
attribute_deprecated
int
url_read_complete
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
attribute_deprecated
int
url_write
(
URLContext
*
h
,
const
unsigned
char
*
buf
,
int
size
);
attribute_deprecated
int
url_write
(
URLContext
*
h
,
const
unsigned
char
*
buf
,
int
size
);
attribute_deprecated
int64_t
url_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
attribute_deprecated
int64_t
url_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
attribute_deprecated
int
url_close
(
URLContext
*
h
);
#endif
#endif
/**
* Close the resource accessed by the URLContext h, and free the
* memory used by it.
*
* @return a negative value if an error condition occurred, 0
* otherwise
*/
int
url_close
(
URLContext
*
h
);
/**
/**
* Return a non-zero value if the resource indicated by url
* Return a non-zero value if the resource indicated by url
* exists, 0 otherwise.
* exists, 0 otherwise.
...
...
libavformat/aviobuf.c
View file @
e52a9145
...
@@ -950,7 +950,7 @@ int avio_open(AVIOContext **s, const char *filename, int flags)
...
@@ -950,7 +950,7 @@ int avio_open(AVIOContext **s, const char *filename, int flags)
return
err
;
return
err
;
err
=
ffio_fdopen
(
s
,
h
);
err
=
ffio_fdopen
(
s
,
h
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
url_close
(
h
);
ff
url_close
(
h
);
return
err
;
return
err
;
}
}
return
0
;
return
0
;
...
@@ -962,7 +962,7 @@ int avio_close(AVIOContext *s)
...
@@ -962,7 +962,7 @@ int avio_close(AVIOContext *s)
av_free
(
s
->
buffer
);
av_free
(
s
->
buffer
);
av_free
(
s
);
av_free
(
s
);
return
url_close
(
h
);
return
ff
url_close
(
h
);
}
}
#if FF_API_OLD_AVIO
#if FF_API_OLD_AVIO
...
...
libavformat/concat.c
View file @
e52a9145
...
@@ -47,7 +47,7 @@ static av_cold int concat_close(URLContext *h)
...
@@ -47,7 +47,7 @@ static av_cold int concat_close(URLContext *h)
struct
concat_nodes
*
nodes
=
data
->
nodes
;
struct
concat_nodes
*
nodes
=
data
->
nodes
;
for
(
i
=
0
;
i
!=
data
->
length
;
i
++
)
for
(
i
=
0
;
i
!=
data
->
length
;
i
++
)
err
|=
url_close
(
nodes
[
i
].
uc
);
err
|=
ff
url_close
(
nodes
[
i
].
uc
);
av_freep
(
&
data
->
nodes
);
av_freep
(
&
data
->
nodes
);
av_freep
(
&
h
->
priv_data
);
av_freep
(
&
h
->
priv_data
);
...
@@ -106,7 +106,7 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
...
@@ -106,7 +106,7 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
/* creating size */
/* creating size */
if
((
size
=
url_filesize
(
uc
))
<
0
)
{
if
((
size
=
url_filesize
(
uc
))
<
0
)
{
url_close
(
uc
);
ff
url_close
(
uc
);
err
=
AVERROR
(
ENOSYS
);
err
=
AVERROR
(
ENOSYS
);
break
;
break
;
}
}
...
...
libavformat/gopher.c
View file @
e52a9145
...
@@ -69,7 +69,7 @@ static int gopher_close(URLContext *h)
...
@@ -69,7 +69,7 @@ static int gopher_close(URLContext *h)
{
{
GopherContext
*
s
=
h
->
priv_data
;
GopherContext
*
s
=
h
->
priv_data
;
if
(
s
->
hd
)
{
if
(
s
->
hd
)
{
url_close
(
s
->
hd
);
ff
url_close
(
s
->
hd
);
s
->
hd
=
NULL
;
s
->
hd
=
NULL
;
}
}
av_freep
(
&
h
->
priv_data
);
av_freep
(
&
h
->
priv_data
);
...
...
libavformat/http.c
View file @
e52a9145
...
@@ -134,7 +134,7 @@ static int http_open_cnx(URLContext *h)
...
@@ -134,7 +134,7 @@ static int http_open_cnx(URLContext *h)
goto
fail
;
goto
fail
;
if
(
s
->
http_code
==
401
)
{
if
(
s
->
http_code
==
401
)
{
if
(
cur_auth_type
==
HTTP_AUTH_NONE
&&
s
->
auth_state
.
auth_type
!=
HTTP_AUTH_NONE
)
{
if
(
cur_auth_type
==
HTTP_AUTH_NONE
&&
s
->
auth_state
.
auth_type
!=
HTTP_AUTH_NONE
)
{
url_close
(
hd
);
ff
url_close
(
hd
);
goto
redo
;
goto
redo
;
}
else
}
else
goto
fail
;
goto
fail
;
...
@@ -142,7 +142,7 @@ static int http_open_cnx(URLContext *h)
...
@@ -142,7 +142,7 @@ static int http_open_cnx(URLContext *h)
if
((
s
->
http_code
==
301
||
s
->
http_code
==
302
||
s
->
http_code
==
303
||
s
->
http_code
==
307
)
if
((
s
->
http_code
==
301
||
s
->
http_code
==
302
||
s
->
http_code
==
303
||
s
->
http_code
==
307
)
&&
location_changed
==
1
)
{
&&
location_changed
==
1
)
{
/* url moved, get next */
/* url moved, get next */
url_close
(
hd
);
ff
url_close
(
hd
);
if
(
redirects
++
>=
MAX_REDIRECTS
)
if
(
redirects
++
>=
MAX_REDIRECTS
)
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
location_changed
=
0
;
location_changed
=
0
;
...
@@ -151,7 +151,7 @@ static int http_open_cnx(URLContext *h)
...
@@ -151,7 +151,7 @@ static int http_open_cnx(URLContext *h)
return
0
;
return
0
;
fail:
fail:
if
(
hd
)
if
(
hd
)
url_close
(
hd
);
ff
url_close
(
hd
);
s
->
hd
=
NULL
;
s
->
hd
=
NULL
;
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
...
@@ -457,7 +457,7 @@ static int http_close(URLContext *h)
...
@@ -457,7 +457,7 @@ static int http_close(URLContext *h)
}
}
if
(
s
->
hd
)
if
(
s
->
hd
)
url_close
(
s
->
hd
);
ff
url_close
(
s
->
hd
);
return
ret
;
return
ret
;
}
}
...
@@ -493,7 +493,7 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
...
@@ -493,7 +493,7 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
s
->
off
=
old_off
;
s
->
off
=
old_off
;
return
-
1
;
return
-
1
;
}
}
url_close
(
old_hd
);
ff
url_close
(
old_hd
);
return
off
;
return
off
;
}
}
...
...
libavformat/md5proto.c
View file @
e52a9145
...
@@ -69,7 +69,7 @@ static int md5_close(URLContext *h)
...
@@ -69,7 +69,7 @@ static int md5_close(URLContext *h)
if
(
err
)
if
(
err
)
return
err
;
return
err
;
err
=
ffurl_write
(
out
,
buf
,
i
*
2
+
1
);
err
=
ffurl_write
(
out
,
buf
,
i
*
2
+
1
);
url_close
(
out
);
ff
url_close
(
out
);
}
else
{
}
else
{
if
(
fwrite
(
buf
,
1
,
i
*
2
+
1
,
stdout
)
<
i
*
2
+
1
)
if
(
fwrite
(
buf
,
1
,
i
*
2
+
1
,
stdout
)
<
i
*
2
+
1
)
err
=
AVERROR
(
errno
);
err
=
AVERROR
(
errno
);
...
...
libavformat/mmsh.c
View file @
e52a9145
...
@@ -64,7 +64,7 @@ static int mmsh_close(URLContext *h)
...
@@ -64,7 +64,7 @@ static int mmsh_close(URLContext *h)
MMSHContext
*
mmsh
=
(
MMSHContext
*
)
h
->
priv_data
;
MMSHContext
*
mmsh
=
(
MMSHContext
*
)
h
->
priv_data
;
MMSContext
*
mms
=
&
mmsh
->
mms
;
MMSContext
*
mms
=
&
mmsh
->
mms
;
if
(
mms
->
mms_hd
)
if
(
mms
->
mms_hd
)
url_close
(
mms
->
mms_hd
);
ff
url_close
(
mms
->
mms_hd
);
av_free
(
mms
->
streams
);
av_free
(
mms
->
streams
);
av_free
(
mms
->
asf_header
);
av_free
(
mms
->
asf_header
);
av_freep
(
&
h
->
priv_data
);
av_freep
(
&
h
->
priv_data
);
...
@@ -259,7 +259,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
...
@@ -259,7 +259,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
}
}
// close the socket and then reopen it for sending the second play request.
// close the socket and then reopen it for sending the second play request.
url_close
(
mms
->
mms_hd
);
ff
url_close
(
mms
->
mms_hd
);
memset
(
headers
,
0
,
sizeof
(
headers
));
memset
(
headers
,
0
,
sizeof
(
headers
));
if
(
ffurl_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
if
(
ffurl_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
...
...
libavformat/mmst.c
View file @
e52a9145
...
@@ -464,7 +464,7 @@ static int mms_close(URLContext *h)
...
@@ -464,7 +464,7 @@ static int mms_close(URLContext *h)
MMSContext
*
mms
=
&
mmst
->
mms
;
MMSContext
*
mms
=
&
mmst
->
mms
;
if
(
mms
->
mms_hd
)
{
if
(
mms
->
mms_hd
)
{
send_close_packet
(
mmst
);
send_close_packet
(
mmst
);
url_close
(
mms
->
mms_hd
);
ff
url_close
(
mms
->
mms_hd
);
}
}
/* free all separately allocated pointers in mms */
/* free all separately allocated pointers in mms */
...
...
libavformat/rtmpproto.c
View file @
e52a9145
...
@@ -786,7 +786,7 @@ static int rtmp_close(URLContext *h)
...
@@ -786,7 +786,7 @@ static int rtmp_close(URLContext *h)
gen_delete_stream
(
h
,
rt
);
gen_delete_stream
(
h
,
rt
);
av_freep
(
&
rt
->
flv_data
);
av_freep
(
&
rt
->
flv_data
);
url_close
(
rt
->
stream
);
ff
url_close
(
rt
->
stream
);
av_free
(
rt
);
av_free
(
rt
);
return
0
;
return
0
;
}
}
...
...
libavformat/rtpproto.c
View file @
e52a9145
...
@@ -212,9 +212,9 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
...
@@ -212,9 +212,9 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
fail:
fail:
if
(
s
->
rtp_hd
)
if
(
s
->
rtp_hd
)
url_close
(
s
->
rtp_hd
);
ff
url_close
(
s
->
rtp_hd
);
if
(
s
->
rtcp_hd
)
if
(
s
->
rtcp_hd
)
url_close
(
s
->
rtcp_hd
);
ff
url_close
(
s
->
rtcp_hd
);
av_free
(
s
);
av_free
(
s
);
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
...
@@ -313,8 +313,8 @@ static int rtp_close(URLContext *h)
...
@@ -313,8 +313,8 @@ static int rtp_close(URLContext *h)
{
{
RTPContext
*
s
=
h
->
priv_data
;
RTPContext
*
s
=
h
->
priv_data
;
url_close
(
s
->
rtp_hd
);
ff
url_close
(
s
->
rtp_hd
);
url_close
(
s
->
rtcp_hd
);
ff
url_close
(
s
->
rtcp_hd
);
av_free
(
s
);
av_free
(
s
);
return
0
;
return
0
;
}
}
...
...
libavformat/rtsp.c
View file @
e52a9145
...
@@ -509,7 +509,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
...
@@ -509,7 +509,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
}
}
rtsp_st
->
transport_priv
=
NULL
;
rtsp_st
->
transport_priv
=
NULL
;
if
(
rtsp_st
->
rtp_handle
)
if
(
rtsp_st
->
rtp_handle
)
url_close
(
rtsp_st
->
rtp_handle
);
ff
url_close
(
rtsp_st
->
rtp_handle
);
rtsp_st
->
rtp_handle
=
NULL
;
rtsp_st
->
rtp_handle
=
NULL
;
}
}
}
}
...
@@ -1297,8 +1297,8 @@ fail:
...
@@ -1297,8 +1297,8 @@ fail:
void
ff_rtsp_close_connections
(
AVFormatContext
*
s
)
void
ff_rtsp_close_connections
(
AVFormatContext
*
s
)
{
{
RTSPState
*
rt
=
s
->
priv_data
;
RTSPState
*
rt
=
s
->
priv_data
;
if
(
rt
->
rtsp_hd_out
!=
rt
->
rtsp_hd
)
url_close
(
rt
->
rtsp_hd_out
);
if
(
rt
->
rtsp_hd_out
!=
rt
->
rtsp_hd
)
ff
url_close
(
rt
->
rtsp_hd_out
);
url_close
(
rt
->
rtsp_hd
);
ff
url_close
(
rt
->
rtsp_hd
);
rt
->
rtsp_hd
=
rt
->
rtsp_hd_out
=
NULL
;
rt
->
rtsp_hd
=
rt
->
rtsp_hd_out
=
NULL
;
}
}
...
@@ -1888,7 +1888,7 @@ static int rtp_read_header(AVFormatContext *s,
...
@@ -1888,7 +1888,7 @@ static int rtp_read_header(AVFormatContext *s,
break
;
break
;
}
}
getsockname
(
url_get_file_handle
(
in
),
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
getsockname
(
url_get_file_handle
(
in
),
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
url_close
(
in
);
ff
url_close
(
in
);
in
=
NULL
;
in
=
NULL
;
memset
(
&
codec
,
0
,
sizeof
(
codec
));
memset
(
&
codec
,
0
,
sizeof
(
codec
));
...
@@ -1927,7 +1927,7 @@ static int rtp_read_header(AVFormatContext *s,
...
@@ -1927,7 +1927,7 @@ static int rtp_read_header(AVFormatContext *s,
fail:
fail:
if
(
in
)
if
(
in
)
url_close
(
in
);
ff
url_close
(
in
);
ff_network_close
();
ff_network_close
();
return
ret
;
return
ret
;
}
}
...
...
libavformat/sapdec.c
View file @
e52a9145
...
@@ -54,7 +54,7 @@ static int sap_read_close(AVFormatContext *s)
...
@@ -54,7 +54,7 @@ static int sap_read_close(AVFormatContext *s)
if
(
sap
->
sdp_ctx
)
if
(
sap
->
sdp_ctx
)
av_close_input_stream
(
sap
->
sdp_ctx
);
av_close_input_stream
(
sap
->
sdp_ctx
);
if
(
sap
->
ann_fd
)
if
(
sap
->
ann_fd
)
url_close
(
sap
->
ann_fd
);
ff
url_close
(
sap
->
ann_fd
);
av_freep
(
&
sap
->
sdp
);
av_freep
(
&
sap
->
sdp
);
ff_network_close
();
ff_network_close
();
return
0
;
return
0
;
...
...
libavformat/sapenc.c
View file @
e52a9145
...
@@ -59,7 +59,7 @@ static int sap_write_close(AVFormatContext *s)
...
@@ -59,7 +59,7 @@ static int sap_write_close(AVFormatContext *s)
av_freep
(
&
sap
->
ann
);
av_freep
(
&
sap
->
ann
);
if
(
sap
->
ann_fd
)
if
(
sap
->
ann_fd
)
url_close
(
sap
->
ann_fd
);
ff
url_close
(
sap
->
ann_fd
);
ff_network_close
();
ff_network_close
();
return
0
;
return
0
;
}
}
...
...
libavformat/url.h
View file @
e52a9145
...
@@ -102,4 +102,13 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size);
...
@@ -102,4 +102,13 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size);
*/
*/
int64_t
ffurl_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
int64_t
ffurl_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
/**
* Close the resource accessed by the URLContext h, and free the
* memory used by it.
*
* @return a negative value if an error condition occurred, 0
* otherwise
*/
int
ffurl_close
(
URLContext
*
h
);
#endif //AVFORMAT_URL_H
#endif //AVFORMAT_URL_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment