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
708df4ac
Commit
708df4ac
authored
Dec 04, 2011
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: remove global video state
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
1d0ae92a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
ffplay.c
ffplay.c
+3
-11
No files found.
ffplay.c
View file @
708df4ac
...
...
@@ -2421,13 +2421,10 @@ static void stream_component_close(VideoState *is, int stream_index)
}
}
/* since we have only one decoding thread, we can use a global
variable instead of a thread local variable */
static
VideoState
*
global_video_state
;
static
int
decode_interrupt_cb
(
void
*
ctx
)
{
return
(
global_video_state
&&
global_video_state
->
abort_request
);
VideoState
*
is
=
ctx
;
return
is
->
abort_request
;
}
/* this thread gets the stream from the disk or the network */
...
...
@@ -2449,10 +2446,9 @@ static int read_thread(void *arg)
is
->
audio_stream
=
-
1
;
is
->
subtitle_stream
=
-
1
;
global_video_state
=
is
;
ic
=
avformat_alloc_context
();
ic
->
interrupt_callback
.
callback
=
decode_interrupt_cb
;
ic
->
interrupt_callback
.
opaque
=
is
;
err
=
avformat_open_input
(
&
ic
,
is
->
filename
,
is
->
iformat
,
&
format_opts
);
if
(
err
<
0
)
{
print_error
(
is
->
filename
,
err
);
...
...
@@ -2669,9 +2665,6 @@ static int read_thread(void *arg)
ret
=
0
;
fail:
/* disable interrupting */
global_video_state
=
NULL
;
/* close each stream */
if
(
is
->
audio_stream
>=
0
)
stream_component_close
(
is
,
is
->
audio_stream
);
...
...
@@ -2682,7 +2675,6 @@ static int read_thread(void *arg)
if
(
is
->
ic
)
{
avformat_close_input
(
&
is
->
ic
);
}
avio_set_interrupt_cb
(
NULL
);
if
(
ret
!=
0
)
{
SDL_Event
event
;
...
...
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