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
d5708923
Commit
d5708923
authored
Jun 16, 2011
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move do_exit() and stream_close() up.
parent
5ad05dd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
51 deletions
+51
-51
ffplay.c
ffplay.c
+51
-51
No files found.
ffplay.c
View file @
d5708923
...
...
@@ -856,6 +856,57 @@ static void video_audio_display(VideoState *s)
}
}
static
void
stream_close
(
VideoState
*
is
)
{
VideoPicture
*
vp
;
int
i
;
/* XXX: use a special url_shutdown call to abort parse cleanly */
is
->
abort_request
=
1
;
SDL_WaitThread
(
is
->
read_tid
,
NULL
);
SDL_WaitThread
(
is
->
refresh_tid
,
NULL
);
/* free all pictures */
for
(
i
=
0
;
i
<
VIDEO_PICTURE_QUEUE_SIZE
;
i
++
)
{
vp
=
&
is
->
pictq
[
i
];
#if CONFIG_AVFILTER
if
(
vp
->
picref
)
{
avfilter_unref_buffer
(
vp
->
picref
);
vp
->
picref
=
NULL
;
}
#endif
if
(
vp
->
bmp
)
{
SDL_FreeYUVOverlay
(
vp
->
bmp
);
vp
->
bmp
=
NULL
;
}
}
SDL_DestroyMutex
(
is
->
pictq_mutex
);
SDL_DestroyCond
(
is
->
pictq_cond
);
SDL_DestroyMutex
(
is
->
subpq_mutex
);
SDL_DestroyCond
(
is
->
subpq_cond
);
#if !CONFIG_AVFILTER
if
(
is
->
img_convert_ctx
)
sws_freeContext
(
is
->
img_convert_ctx
);
#endif
av_free
(
is
);
}
static
void
do_exit
(
void
)
{
if
(
cur_stream
)
{
stream_close
(
cur_stream
);
cur_stream
=
NULL
;
}
uninit_opts
();
#if CONFIG_AVFILTER
avfilter_uninit
();
#endif
if
(
show_status
)
printf
(
"
\n
"
);
SDL_Quit
();
av_log
(
NULL
,
AV_LOG_QUIET
,
""
);
exit
(
0
);
}
static
int
video_open
(
VideoState
*
is
){
int
flags
=
SDL_HWSURFACE
|
SDL_ASYNCBLIT
|
SDL_HWACCEL
;
int
w
,
h
;
...
...
@@ -1204,57 +1255,6 @@ retry:
}
}
static
void
stream_close
(
VideoState
*
is
)
{
VideoPicture
*
vp
;
int
i
;
/* XXX: use a special url_shutdown call to abort parse cleanly */
is
->
abort_request
=
1
;
SDL_WaitThread
(
is
->
read_tid
,
NULL
);
SDL_WaitThread
(
is
->
refresh_tid
,
NULL
);
/* free all pictures */
for
(
i
=
0
;
i
<
VIDEO_PICTURE_QUEUE_SIZE
;
i
++
)
{
vp
=
&
is
->
pictq
[
i
];
#if CONFIG_AVFILTER
if
(
vp
->
picref
)
{
avfilter_unref_buffer
(
vp
->
picref
);
vp
->
picref
=
NULL
;
}
#endif
if
(
vp
->
bmp
)
{
SDL_FreeYUVOverlay
(
vp
->
bmp
);
vp
->
bmp
=
NULL
;
}
}
SDL_DestroyMutex
(
is
->
pictq_mutex
);
SDL_DestroyCond
(
is
->
pictq_cond
);
SDL_DestroyMutex
(
is
->
subpq_mutex
);
SDL_DestroyCond
(
is
->
subpq_cond
);
#if !CONFIG_AVFILTER
if
(
is
->
img_convert_ctx
)
sws_freeContext
(
is
->
img_convert_ctx
);
#endif
av_free
(
is
);
}
static
void
do_exit
(
void
)
{
if
(
cur_stream
)
{
stream_close
(
cur_stream
);
cur_stream
=
NULL
;
}
uninit_opts
();
#if CONFIG_AVFILTER
avfilter_uninit
();
#endif
if
(
show_status
)
printf
(
"
\n
"
);
SDL_Quit
();
av_log
(
NULL
,
AV_LOG_QUIET
,
""
);
exit
(
0
);
}
/* allocate a picture (needs to do that in main thread to avoid
potential locking problems */
static
void
alloc_picture
(
void
*
opaque
)
...
...
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