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
17acc63a
Commit
17acc63a
authored
Dec 17, 2007
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify av_open_input_file
Originally committed as revision 11253 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b0797570
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
utils.c
libavformat/utils.c
+5
-13
No files found.
libavformat/utils.c
View file @
17acc63a
...
@@ -417,11 +417,10 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -417,11 +417,10 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
int
buf_size
,
int
buf_size
,
AVFormatParameters
*
ap
)
AVFormatParameters
*
ap
)
{
{
int
err
,
must_open_file
,
file_opened
,
probe_size
;
int
err
,
probe_size
;
AVProbeData
probe_data
,
*
pd
=
&
probe_data
;
AVProbeData
probe_data
,
*
pd
=
&
probe_data
;
ByteIOContext
*
pb
;
ByteIOContext
*
pb
=
NULL
;
file_opened
=
0
;
pd
->
filename
=
""
;
pd
->
filename
=
""
;
if
(
filename
)
if
(
filename
)
pd
->
filename
=
filename
;
pd
->
filename
=
filename
;
...
@@ -435,18 +434,11 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -435,18 +434,11 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
/* do not open file if the format does not need it. XXX: specific
/* do not open file if the format does not need it. XXX: specific
hack needed to handle RTSP/TCP */
hack needed to handle RTSP/TCP */
must_open_file
=
1
;
if
(
!
fmt
||
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
fmt
&&
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
must_open_file
=
0
;
pb
=
NULL
;
//FIXME this or memset(pb, 0, sizeof(ByteIOContext)); otherwise it is uninitialized
}
if
(
!
fmt
||
must_open_file
)
{
/* if no file needed do not try to open one */
/* if no file needed do not try to open one */
if
((
err
=
url_fopen
(
&
pb
,
filename
,
URL_RDONLY
))
<
0
)
{
if
((
err
=
url_fopen
(
&
pb
,
filename
,
URL_RDONLY
))
<
0
)
{
goto
fail
;
goto
fail
;
}
}
file_opened
=
1
;
if
(
buf_size
>
0
)
{
if
(
buf_size
>
0
)
{
url_setbufsize
(
pb
,
buf_size
);
url_setbufsize
(
pb
,
buf_size
);
}
}
...
@@ -460,7 +452,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -460,7 +452,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
if
(
url_fseek
(
pb
,
0
,
SEEK_SET
)
<
0
)
{
if
(
url_fseek
(
pb
,
0
,
SEEK_SET
)
<
0
)
{
url_fclose
(
pb
);
url_fclose
(
pb
);
if
(
url_fopen
(
&
pb
,
filename
,
URL_RDONLY
)
<
0
)
{
if
(
url_fopen
(
&
pb
,
filename
,
URL_RDONLY
)
<
0
)
{
file_opened
=
0
;
pb
=
NULL
;
err
=
AVERROR
(
EIO
);
err
=
AVERROR
(
EIO
);
goto
fail
;
goto
fail
;
}
}
...
@@ -490,7 +482,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
...
@@ -490,7 +482,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
return
0
;
return
0
;
fail:
fail:
av_freep
(
&
pd
->
buf
);
av_freep
(
&
pd
->
buf
);
if
(
file_opened
)
if
(
pb
)
url_fclose
(
pb
);
url_fclose
(
pb
);
*
ic_ptr
=
NULL
;
*
ic_ptr
=
NULL
;
return
err
;
return
err
;
...
...
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