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
b6bde8c7
Commit
b6bde8c7
authored
Jun 09, 2011
by
Anton Khirnov
Committed by
Michael Niedermayer
Jun 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: use new avformat_open_* API.
parent
c9584f0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
23 deletions
+9
-23
ffplay.c
ffplay.c
+9
-23
No files found.
ffplay.c
View file @
b6bde8c7
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "libavutil/colorspace.h"
#include "libavutil/colorspace.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "libavutil/dict.h"
#include "libavutil/parseutils.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/samplefmt.h"
#include "libavutil/avassert.h"
#include "libavutil/avassert.h"
...
@@ -2295,15 +2296,13 @@ static int decode_interrupt_cb(void)
...
@@ -2295,15 +2296,13 @@ static int decode_interrupt_cb(void)
static
int
read_thread
(
void
*
arg
)
static
int
read_thread
(
void
*
arg
)
{
{
VideoState
*
is
=
arg
;
VideoState
*
is
=
arg
;
AVFormatContext
*
ic
;
AVFormatContext
*
ic
=
NULL
;
int
err
,
i
,
ret
;
int
err
,
i
,
ret
;
int
st_index
[
AVMEDIA_TYPE_NB
];
int
st_index
[
AVMEDIA_TYPE_NB
];
AVPacket
pkt1
,
*
pkt
=
&
pkt1
;
AVPacket
pkt1
,
*
pkt
=
&
pkt1
;
AVFormatParameters
params
,
*
ap
=
&
params
;
int
eof
=
0
;
int
eof
=
0
;
int
pkt_in_play_range
=
0
;
int
pkt_in_play_range
=
0
;
AVDictionaryEntry
*
t
;
ic
=
avformat_alloc_context
();
memset
(
st_index
,
-
1
,
sizeof
(
st_index
));
memset
(
st_index
,
-
1
,
sizeof
(
st_index
));
is
->
video_stream
=
-
1
;
is
->
video_stream
=
-
1
;
...
@@ -2313,30 +2312,17 @@ static int read_thread(void *arg)
...
@@ -2313,30 +2312,17 @@ static int read_thread(void *arg)
global_video_state
=
is
;
global_video_state
=
is
;
avio_set_interrupt_cb
(
decode_interrupt_cb
);
avio_set_interrupt_cb
(
decode_interrupt_cb
);
memset
(
ap
,
0
,
sizeof
(
*
ap
));
err
=
avformat_open_input
(
&
ic
,
is
->
filename
,
is
->
iformat
,
&
format_opts
);
ap
->
prealloced_context
=
1
;
ap
->
width
=
frame_width
;
ap
->
height
=
frame_height
;
ap
->
time_base
=
(
AVRational
){
1
,
25
};
ap
->
pix_fmt
=
frame_pix_fmt
;
ic
->
flags
|=
AVFMT_FLAG_PRIV_OPT
;
err
=
av_open_input_file
(
&
ic
,
is
->
filename
,
is
->
iformat
,
0
,
ap
);
if
(
err
>=
0
)
{
set_context_opts
(
ic
,
avformat_opts
,
AV_OPT_FLAG_DECODING_PARAM
,
NULL
);
err
=
av_demuxer_open
(
ic
,
ap
);
if
(
err
<
0
){
avformat_free_context
(
ic
);
ic
=
NULL
;
}
}
if
(
err
<
0
)
{
if
(
err
<
0
)
{
print_error
(
is
->
filename
,
err
);
print_error
(
is
->
filename
,
err
);
ret
=
-
1
;
ret
=
-
1
;
goto
fail
;
goto
fail
;
}
}
if
((
t
=
av_dict_get
(
format_opts
,
""
,
NULL
,
AV_DICT_IGNORE_SUFFIX
)))
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Option %s not found.
\n
"
,
t
->
key
);
ret
=
AVERROR_OPTION_NOT_FOUND
;
goto
fail
;
}
is
->
ic
=
ic
;
is
->
ic
=
ic
;
if
(
genpts
)
if
(
genpts
)
...
...
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