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
22a3212e
Commit
22a3212e
authored
Feb 21, 2011
by
Anton Khirnov
Committed by
Ronald S. Bultje
Feb 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: rename url_fopen/fclose -> avio_open/close.
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
28c4741a
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
55 additions
and
34 deletions
+55
-34
ffmpeg.c
ffmpeg.c
+2
-2
ffserver.c
ffserver.c
+2
-2
applehttp.c
libavformat/applehttp.c
+8
-8
avformat.h
libavformat/avformat.h
+1
-1
avio.h
libavformat/avio.h
+14
-2
aviobuf.c
libavformat/aviobuf.c
+11
-2
img2.c
libavformat/img2.c
+6
-6
mov.c
libavformat/mov.c
+2
-2
output-example.c
libavformat/output-example.c
+2
-2
rtpenc_chain.c
libavformat/rtpenc_chain.c
+1
-1
rtsp.c
libavformat/rtsp.c
+1
-1
rtspdec.c
libavformat/rtspdec.c
+1
-1
sapenc.c
libavformat/sapenc.c
+1
-1
utils.c
libavformat/utils.c
+3
-3
No files found.
ffmpeg.c
View file @
22a3212e
...
@@ -508,7 +508,7 @@ static int ffmpeg_exit(int ret)
...
@@ -508,7 +508,7 @@ static int ffmpeg_exit(int ret)
AVFormatContext
*
s
=
output_files
[
i
];
AVFormatContext
*
s
=
output_files
[
i
];
int
j
;
int
j
;
if
(
!
(
s
->
oformat
->
flags
&
AVFMT_NOFILE
)
&&
s
->
pb
)
if
(
!
(
s
->
oformat
->
flags
&
AVFMT_NOFILE
)
&&
s
->
pb
)
url_f
close
(
s
->
pb
);
avio_
close
(
s
->
pb
);
avformat_free_context
(
s
);
avformat_free_context
(
s
);
av_free
(
output_streams_for_file
[
i
]);
av_free
(
output_streams_for_file
[
i
]);
}
}
...
@@ -3789,7 +3789,7 @@ static void opt_output_file(const char *filename)
...
@@ -3789,7 +3789,7 @@ static void opt_output_file(const char *filename)
}
}
/* open the file */
/* open the file */
if
((
err
=
url_f
open
(
&
oc
->
pb
,
filename
,
URL_WRONLY
))
<
0
)
{
if
((
err
=
avio_
open
(
&
oc
->
pb
,
filename
,
URL_WRONLY
))
<
0
)
{
print_error
(
filename
,
err
);
print_error
(
filename
,
err
);
ffmpeg_exit
(
1
);
ffmpeg_exit
(
1
);
}
}
...
...
ffserver.c
View file @
22a3212e
...
@@ -3764,7 +3764,7 @@ static void build_feed_streams(void)
...
@@ -3764,7 +3764,7 @@ static void build_feed_streams(void)
}
}
/* only write the header of the ffm file */
/* only write the header of the ffm file */
if
(
url_f
open
(
&
s
->
pb
,
feed
->
feed_filename
,
URL_WRONLY
)
<
0
)
{
if
(
avio_
open
(
&
s
->
pb
,
feed
->
feed_filename
,
URL_WRONLY
)
<
0
)
{
http_log
(
"Could not open output feed file '%s'
\n
"
,
http_log
(
"Could not open output feed file '%s'
\n
"
,
feed
->
feed_filename
);
feed
->
feed_filename
);
exit
(
1
);
exit
(
1
);
...
@@ -3783,7 +3783,7 @@ static void build_feed_streams(void)
...
@@ -3783,7 +3783,7 @@ static void build_feed_streams(void)
}
}
/* XXX: need better api */
/* XXX: need better api */
av_freep
(
&
s
->
priv_data
);
av_freep
(
&
s
->
priv_data
);
url_f
close
(
s
->
pb
);
avio_
close
(
s
->
pb
);
}
}
/* get feed size and write index */
/* get feed size and write index */
fd
=
open
(
feed
->
feed_filename
,
O_RDONLY
);
fd
=
open
(
feed
->
feed_filename
,
O_RDONLY
);
...
...
libavformat/applehttp.c
View file @
22a3212e
...
@@ -154,7 +154,7 @@ static void free_variant_list(AppleHTTPContext *c)
...
@@ -154,7 +154,7 @@ static void free_variant_list(AppleHTTPContext *c)
free_segment_list
(
var
);
free_segment_list
(
var
);
av_free_packet
(
&
var
->
pkt
);
av_free_packet
(
&
var
->
pkt
);
if
(
var
->
pb
)
if
(
var
->
pb
)
url_f
close
(
var
->
pb
);
avio_
close
(
var
->
pb
);
if
(
var
->
ctx
)
{
if
(
var
->
ctx
)
{
var
->
ctx
->
pb
=
NULL
;
var
->
ctx
->
pb
=
NULL
;
av_close_input_file
(
var
->
ctx
);
av_close_input_file
(
var
->
ctx
);
...
@@ -211,7 +211,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
...
@@ -211,7 +211,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
if
(
!
in
)
{
if
(
!
in
)
{
close_in
=
1
;
close_in
=
1
;
if
((
ret
=
url_f
open
(
&
in
,
url
,
URL_RDONLY
))
<
0
)
if
((
ret
=
avio_
open
(
&
in
,
url
,
URL_RDONLY
))
<
0
)
return
ret
;
return
ret
;
}
}
...
@@ -284,7 +284,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
...
@@ -284,7 +284,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
fail:
fail:
if
(
close_in
)
if
(
close_in
)
url_f
close
(
in
);
avio_
close
(
in
);
return
ret
;
return
ret
;
}
}
...
@@ -338,7 +338,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -338,7 +338,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
ret
=
av_open_input_file
(
&
v
->
ctx
,
v
->
segments
[
0
]
->
url
,
NULL
,
0
,
NULL
);
ret
=
av_open_input_file
(
&
v
->
ctx
,
v
->
segments
[
0
]
->
url
,
NULL
,
0
,
NULL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
url_f
close
(
v
->
ctx
->
pb
);
avio_
close
(
v
->
ctx
->
pb
);
v
->
ctx
->
pb
=
NULL
;
v
->
ctx
->
pb
=
NULL
;
v
->
stream_offset
=
stream_offset
;
v
->
stream_offset
=
stream_offset
;
/* Create new AVStreams for each stream in this variant */
/* Create new AVStreams for each stream in this variant */
...
@@ -378,7 +378,7 @@ static int open_variant(AppleHTTPContext *c, struct variant *var, int skip)
...
@@ -378,7 +378,7 @@ static int open_variant(AppleHTTPContext *c, struct variant *var, int skip)
}
}
if
(
c
->
cur_seq_no
-
var
->
start_seq_no
>=
var
->
n_segments
)
if
(
c
->
cur_seq_no
-
var
->
start_seq_no
>=
var
->
n_segments
)
return
c
->
finished
?
AVERROR_EOF
:
0
;
return
c
->
finished
?
AVERROR_EOF
:
0
;
ret
=
url_f
open
(
&
var
->
pb
,
ret
=
avio_
open
(
&
var
->
pb
,
var
->
segments
[
c
->
cur_seq_no
-
var
->
start_seq_no
]
->
url
,
var
->
segments
[
c
->
cur_seq_no
-
var
->
start_seq_no
]
->
url
,
URL_RDONLY
);
URL_RDONLY
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -435,7 +435,7 @@ start:
...
@@ -435,7 +435,7 @@ start:
"Closing variant stream %d, no longer needed
\n
"
,
i
);
"Closing variant stream %d, no longer needed
\n
"
,
i
);
av_free_packet
(
&
var
->
pkt
);
av_free_packet
(
&
var
->
pkt
);
reset_packet
(
&
var
->
pkt
);
reset_packet
(
&
var
->
pkt
);
url_f
close
(
var
->
pb
);
avio_
close
(
var
->
pb
);
var
->
pb
=
NULL
;
var
->
pb
=
NULL
;
changed
=
1
;
changed
=
1
;
}
else
if
(
!
var
->
pb
&&
var
->
needed
)
{
}
else
if
(
!
var
->
pb
&&
var
->
needed
)
{
...
@@ -484,7 +484,7 @@ start:
...
@@ -484,7 +484,7 @@ start:
for
(
i
=
0
;
i
<
c
->
n_variants
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
n_variants
;
i
++
)
{
struct
variant
*
var
=
c
->
variants
[
i
];
struct
variant
*
var
=
c
->
variants
[
i
];
if
(
var
->
pb
)
{
if
(
var
->
pb
)
{
url_f
close
(
var
->
pb
);
avio_
close
(
var
->
pb
);
var
->
pb
=
NULL
;
var
->
pb
=
NULL
;
}
}
}
}
...
@@ -558,7 +558,7 @@ static int applehttp_read_seek(AVFormatContext *s, int stream_index,
...
@@ -558,7 +558,7 @@ static int applehttp_read_seek(AVFormatContext *s, int stream_index,
for
(
i
=
0
;
i
<
c
->
n_variants
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
n_variants
;
i
++
)
{
struct
variant
*
var
=
c
->
variants
[
i
];
struct
variant
*
var
=
c
->
variants
[
i
];
if
(
var
->
pb
)
{
if
(
var
->
pb
)
{
url_f
close
(
var
->
pb
);
avio_
close
(
var
->
pb
);
var
->
pb
=
NULL
;
var
->
pb
=
NULL
;
}
}
av_free_packet
(
&
var
->
pkt
);
av_free_packet
(
&
var
->
pkt
);
...
...
libavformat/avformat.h
View file @
22a3212e
...
@@ -261,7 +261,7 @@ typedef struct AVFormatParameters {
...
@@ -261,7 +261,7 @@ typedef struct AVFormatParameters {
#endif
#endif
}
AVFormatParameters
;
}
AVFormatParameters
;
//! Demuxer will use
url_f
open, no opened file should be provided by the caller.
//! Demuxer will use
avio_
open, no opened file should be provided by the caller.
#define AVFMT_NOFILE 0x0001
#define AVFMT_NOFILE 0x0001
#define AVFMT_NEEDNUMBER 0x0002
/**< Needs '%d' in filename. */
#define AVFMT_NEEDNUMBER 0x0002
/**< Needs '%d' in filename. */
#define AVFMT_SHOW_IDS 0x0008
/**< Show format stream IDs numbers. */
#define AVFMT_SHOW_IDS 0x0008
/**< Show format stream IDs numbers. */
...
...
libavformat/avio.h
View file @
22a3212e
...
@@ -410,6 +410,18 @@ attribute_deprecated void put_be16(AVIOContext *s, unsigned int val);
...
@@ -410,6 +410,18 @@ attribute_deprecated void put_be16(AVIOContext *s, unsigned int val);
/**
/**
* @}
* @}
*/
*/
/**
* @defgroup old_url_f_funcs Old url_f* functions
* @deprecated use the avio_ -prefixed functions instead.
* @{
*/
attribute_deprecated
int
url_fopen
(
AVIOContext
**
s
,
const
char
*
url
,
int
flags
);
attribute_deprecated
int
url_fclose
(
AVIOContext
*
s
);
/**
* @}
*/
#endif
#endif
AVIOContext
*
avio_alloc_context
(
AVIOContext
*
avio_alloc_context
(
...
@@ -591,9 +603,9 @@ int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
...
@@ -591,9 +603,9 @@ int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
* @return 0 in case of success, a negative value corresponding to an
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
* AVERROR code in case of failure
*/
*/
int
url_f
open
(
AVIOContext
**
s
,
const
char
*
url
,
int
flags
);
int
avio_
open
(
AVIOContext
**
s
,
const
char
*
url
,
int
flags
);
int
url_f
close
(
AVIOContext
*
s
);
int
avio_
close
(
AVIOContext
*
s
);
URLContext
*
url_fileno
(
AVIOContext
*
s
);
URLContext
*
url_fileno
(
AVIOContext
*
s
);
/**
/**
...
...
libavformat/aviobuf.c
View file @
22a3212e
...
@@ -356,6 +356,15 @@ void put_nbyte(AVIOContext *s, int b, int count)
...
@@ -356,6 +356,15 @@ void put_nbyte(AVIOContext *s, int b, int count)
{
{
ffio_fill
(
s
,
b
,
count
);
ffio_fill
(
s
,
b
,
count
);
}
}
int
url_fopen
(
AVIOContext
**
s
,
const
char
*
filename
,
int
flags
)
{
return
avio_open
(
s
,
filename
,
flags
);
}
int
url_fclose
(
AVIOContext
*
s
)
{
return
avio_close
(
s
);
}
#endif
#endif
int
avio_put_str
(
AVIOContext
*
s
,
const
char
*
str
)
int
avio_put_str
(
AVIOContext
*
s
,
const
char
*
str
)
...
@@ -843,7 +852,7 @@ int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
...
@@ -843,7 +852,7 @@ int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
return
0
;
return
0
;
}
}
int
url_f
open
(
AVIOContext
**
s
,
const
char
*
filename
,
int
flags
)
int
avio_
open
(
AVIOContext
**
s
,
const
char
*
filename
,
int
flags
)
{
{
URLContext
*
h
;
URLContext
*
h
;
int
err
;
int
err
;
...
@@ -859,7 +868,7 @@ int url_fopen(AVIOContext **s, const char *filename, int flags)
...
@@ -859,7 +868,7 @@ int url_fopen(AVIOContext **s, const char *filename, int flags)
return
0
;
return
0
;
}
}
int
url_f
close
(
AVIOContext
*
s
)
int
avio_
close
(
AVIOContext
*
s
)
{
{
URLContext
*
h
=
s
->
opaque
;
URLContext
*
h
=
s
->
opaque
;
...
...
libavformat/img2.c
View file @
22a3212e
...
@@ -269,7 +269,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
...
@@ -269,7 +269,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
s
->
path
,
s
->
img_number
)
<
0
&&
s
->
img_number
>
1
)
s
->
path
,
s
->
img_number
)
<
0
&&
s
->
img_number
>
1
)
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
for
(
i
=
0
;
i
<
3
;
i
++
){
for
(
i
=
0
;
i
<
3
;
i
++
){
if
(
url_f
open
(
&
f
[
i
],
filename
,
URL_RDONLY
)
<
0
)
{
if
(
avio_
open
(
&
f
[
i
],
filename
,
URL_RDONLY
)
<
0
)
{
if
(
i
==
1
)
if
(
i
==
1
)
break
;
break
;
av_log
(
s1
,
AV_LOG_ERROR
,
"Could not open file : %s
\n
"
,
filename
);
av_log
(
s1
,
AV_LOG_ERROR
,
"Could not open file : %s
\n
"
,
filename
);
...
@@ -300,7 +300,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
...
@@ -300,7 +300,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
if
(
size
[
i
]){
if
(
size
[
i
]){
ret
[
i
]
=
avio_read
(
f
[
i
],
pkt
->
data
+
pkt
->
size
,
size
[
i
]);
ret
[
i
]
=
avio_read
(
f
[
i
],
pkt
->
data
+
pkt
->
size
,
size
[
i
]);
if
(
!
s
->
is_pipe
)
if
(
!
s
->
is_pipe
)
url_f
close
(
f
[
i
]);
avio_
close
(
f
[
i
]);
if
(
ret
[
i
]
>
0
)
if
(
ret
[
i
]
>
0
)
pkt
->
size
+=
ret
[
i
];
pkt
->
size
+=
ret
[
i
];
}
}
...
@@ -353,7 +353,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -353,7 +353,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
for
(
i
=
0
;
i
<
3
;
i
++
){
for
(
i
=
0
;
i
<
3
;
i
++
){
if
(
url_f
open
(
&
pb
[
i
],
filename
,
URL_WRONLY
)
<
0
)
{
if
(
avio_
open
(
&
pb
[
i
],
filename
,
URL_WRONLY
)
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not open file : %s
\n
"
,
filename
);
av_log
(
s
,
AV_LOG_ERROR
,
"Could not open file : %s
\n
"
,
filename
);
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
...
@@ -373,8 +373,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -373,8 +373,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
avio_write
(
pb
[
2
],
pkt
->
data
+
ysize
+
(
pkt
->
size
-
ysize
)
/
2
,
(
pkt
->
size
-
ysize
)
/
2
);
avio_write
(
pb
[
2
],
pkt
->
data
+
ysize
+
(
pkt
->
size
-
ysize
)
/
2
,
(
pkt
->
size
-
ysize
)
/
2
);
put_flush_packet
(
pb
[
1
]);
put_flush_packet
(
pb
[
1
]);
put_flush_packet
(
pb
[
2
]);
put_flush_packet
(
pb
[
2
]);
url_f
close
(
pb
[
1
]);
avio_
close
(
pb
[
1
]);
url_f
close
(
pb
[
2
]);
avio_
close
(
pb
[
2
]);
}
else
{
}
else
{
if
(
av_str2id
(
img_tags
,
s
->
filename
)
==
CODEC_ID_JPEG2000
){
if
(
av_str2id
(
img_tags
,
s
->
filename
)
==
CODEC_ID_JPEG2000
){
AVStream
*
st
=
s
->
streams
[
0
];
AVStream
*
st
=
s
->
streams
[
0
];
...
@@ -403,7 +403,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -403,7 +403,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
put_flush_packet
(
pb
[
0
]);
put_flush_packet
(
pb
[
0
]);
if
(
!
img
->
is_pipe
)
{
if
(
!
img
->
is_pipe
)
{
url_f
close
(
pb
[
0
]);
avio_
close
(
pb
[
0
]);
}
}
img
->
img_number
++
;
img
->
img_number
++
;
...
...
libavformat/mov.c
View file @
22a3212e
...
@@ -1718,7 +1718,7 @@ static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref)
...
@@ -1718,7 +1718,7 @@ static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref)
av_strlcat
(
filename
,
ref
->
path
+
l
+
1
,
1024
);
av_strlcat
(
filename
,
ref
->
path
+
l
+
1
,
1024
);
if
(
!
url_f
open
(
pb
,
filename
,
URL_RDONLY
))
if
(
!
avio_
open
(
pb
,
filename
,
URL_RDONLY
))
return
0
;
return
0
;
}
}
}
}
...
@@ -2546,7 +2546,7 @@ static int mov_read_close(AVFormatContext *s)
...
@@ -2546,7 +2546,7 @@ static int mov_read_close(AVFormatContext *s)
}
}
av_freep
(
&
sc
->
drefs
);
av_freep
(
&
sc
->
drefs
);
if
(
sc
->
pb
&&
sc
->
pb
!=
s
->
pb
)
if
(
sc
->
pb
&&
sc
->
pb
!=
s
->
pb
)
url_f
close
(
sc
->
pb
);
avio_
close
(
sc
->
pb
);
av_freep
(
&
st
->
codec
->
palctrl
);
av_freep
(
&
st
->
codec
->
palctrl
);
}
}
...
...
libavformat/output-example.c
View file @
22a3212e
...
@@ -492,7 +492,7 @@ int main(int argc, char **argv)
...
@@ -492,7 +492,7 @@ int main(int argc, char **argv)
/* open the output file, if needed */
/* open the output file, if needed */
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
url_f
open
(
&
oc
->
pb
,
filename
,
URL_WRONLY
)
<
0
)
{
if
(
avio_
open
(
&
oc
->
pb
,
filename
,
URL_WRONLY
)
<
0
)
{
fprintf
(
stderr
,
"Could not open '%s'
\n
"
,
filename
);
fprintf
(
stderr
,
"Could not open '%s'
\n
"
,
filename
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -545,7 +545,7 @@ int main(int argc, char **argv)
...
@@ -545,7 +545,7 @@ int main(int argc, char **argv)
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
/* close the output file */
/* close the output file */
url_f
close
(
oc
->
pb
);
avio_
close
(
oc
->
pb
);
}
}
/* free the stream */
/* free the stream */
...
...
libavformat/rtpenc_chain.c
View file @
22a3212e
...
@@ -60,7 +60,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
...
@@ -60,7 +60,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
if
(
ret
)
{
if
(
ret
)
{
if
(
handle
)
{
if
(
handle
)
{
url_f
close
(
rtpctx
->
pb
);
avio_
close
(
rtpctx
->
pb
);
}
else
{
}
else
{
uint8_t
*
ptr
;
uint8_t
*
ptr
;
url_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
url_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
...
...
libavformat/rtsp.c
View file @
22a3212e
...
@@ -498,7 +498,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
...
@@ -498,7 +498,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
url_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
url_close_dyn_buf
(
rtpctx
->
pb
,
&
ptr
);
av_free
(
ptr
);
av_free
(
ptr
);
}
else
{
}
else
{
url_f
close
(
rtpctx
->
pb
);
avio_
close
(
rtpctx
->
pb
);
}
}
avformat_free_context
(
rtpctx
);
avformat_free_context
(
rtpctx
);
}
else
if
(
rt
->
transport
==
RTSP_TRANSPORT_RDT
&&
CONFIG_RTPDEC
)
}
else
if
(
rt
->
transport
==
RTSP_TRANSPORT_RDT
&&
CONFIG_RTPDEC
)
...
...
libavformat/rtspdec.c
View file @
22a3212e
...
@@ -382,7 +382,7 @@ static int rtsp_read_close(AVFormatContext *s)
...
@@ -382,7 +382,7 @@ static int rtsp_read_close(AVFormatContext *s)
#if 0
#if 0
/* NOTE: it is valid to flush the buffer here */
/* NOTE: it is valid to flush the buffer here */
if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
url_f
close(&rt->rtsp_gb);
avio_
close(&rt->rtsp_gb);
}
}
#endif
#endif
ff_rtsp_send_cmd_async
(
s
,
"TEARDOWN"
,
rt
->
control_uri
,
NULL
);
ff_rtsp_send_cmd_async
(
s
,
"TEARDOWN"
,
rt
->
control_uri
,
NULL
);
...
...
libavformat/sapenc.c
View file @
22a3212e
...
@@ -46,7 +46,7 @@ static int sap_write_close(AVFormatContext *s)
...
@@ -46,7 +46,7 @@ static int sap_write_close(AVFormatContext *s)
if
(
!
rtpctx
)
if
(
!
rtpctx
)
continue
;
continue
;
av_write_trailer
(
rtpctx
);
av_write_trailer
(
rtpctx
);
url_f
close
(
rtpctx
->
pb
);
avio_
close
(
rtpctx
->
pb
);
avformat_free_context
(
rtpctx
);
avformat_free_context
(
rtpctx
);
s
->
streams
[
i
]
->
priv_data
=
NULL
;
s
->
streams
[
i
]
->
priv_data
=
NULL
;
}
}
...
...
libavformat/utils.c
View file @
22a3212e
...
@@ -616,7 +616,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -616,7 +616,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
hack needed to handle RTSP/TCP */
hack needed to handle RTSP/TCP */
if
(
!
fmt
||
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
!
fmt
||
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
/* if no file needed do not try to open one */
/* if no file needed do not try to open one */
if
((
err
=
url_f
open
(
&
pb
,
filename
,
URL_RDONLY
))
<
0
)
{
if
((
err
=
avio_
open
(
&
pb
,
filename
,
URL_RDONLY
))
<
0
)
{
goto
fail
;
goto
fail
;
}
}
if
(
buf_size
>
0
)
{
if
(
buf_size
>
0
)
{
...
@@ -647,7 +647,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -647,7 +647,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
fail
:
fail
:
av_freep
(
&
pd
->
buf
);
av_freep
(
&
pd
->
buf
);
if
(
pb
)
if
(
pb
)
url_f
close
(
pb
);
avio_
close
(
pb
);
if
(
ap
&&
ap
->
prealloced_context
)
if
(
ap
&&
ap
->
prealloced_context
)
av_free
(
*
ic_ptr
);
av_free
(
*
ic_ptr
);
*
ic_ptr
=
NULL
;
*
ic_ptr
=
NULL
;
...
@@ -2623,7 +2623,7 @@ void av_close_input_file(AVFormatContext *s)
...
@@ -2623,7 +2623,7 @@ void av_close_input_file(AVFormatContext *s)
AVIOContext
*
pb
=
s
->
iformat
->
flags
&
AVFMT_NOFILE
?
NULL
:
s
->
pb
;
AVIOContext
*
pb
=
s
->
iformat
->
flags
&
AVFMT_NOFILE
?
NULL
:
s
->
pb
;
av_close_input_stream
(
s
);
av_close_input_stream
(
s
);
if
(
pb
)
if
(
pb
)
url_f
close
(
pb
);
avio_
close
(
pb
);
}
}
AVStream
*
av_new_stream
(
AVFormatContext
*
s
,
int
id
)
AVStream
*
av_new_stream
(
AVFormatContext
*
s
,
int
id
)
...
...
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