Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
dcd503d8
Commit
dcd503d8
authored
Sep 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: close acceleration back-end after the context
parent
4af52d5e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
14 deletions
+21
-14
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.c
+18
-14
modules/codec/avcodec/avcodec.h
modules/codec/avcodec/avcodec.h
+1
-0
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+2
-0
No files found.
modules/codec/avcodec/avcodec.c
View file @
dcd503d8
...
@@ -333,22 +333,13 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -333,22 +333,13 @@ static int OpenDecoder( vlc_object_t *p_this )
static
void
CloseDecoder
(
vlc_object_t
*
p_this
)
static
void
CloseDecoder
(
vlc_object_t
*
p_this
)
{
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
switch
(
p_dec
->
fmt_out
.
i_cat
)
if
(
p_dec
->
fmt_out
.
i_cat
==
VIDEO_ES
)
{
EndVideoDec
(
p_dec
);
case
VIDEO_ES
:
else
EndVideoDec
(
p_dec
);
ffmpeg_CloseCodec
(
p_dec
);
break
;
}
if
(
!
p_sys
->
b_delayed_open
)
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
{
vlc_avcodec_lock
();
avcodec_close
(
p_sys
->
p_context
);
vlc_avcodec_unlock
();
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) stopped"
,
p_sys
->
p_codec
->
name
);
}
av_freep
(
&
p_sys
->
p_context
->
extradata
);
av_freep
(
&
p_sys
->
p_context
->
extradata
);
avcodec_free_context
(
&
p_sys
->
p_context
);
avcodec_free_context
(
&
p_sys
->
p_context
);
...
@@ -389,3 +380,16 @@ int ffmpeg_OpenCodec( decoder_t *p_dec )
...
@@ -389,3 +380,16 @@ int ffmpeg_OpenCodec( decoder_t *p_dec )
p_sys
->
b_delayed_open
=
false
;
p_sys
->
b_delayed_open
=
false
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
void
ffmpeg_CloseCodec
(
decoder_t
*
p_dec
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_sys
->
b_delayed_open
)
return
;
vlc_avcodec_lock
();
avcodec_close
(
p_sys
->
p_context
);
vlc_avcodec_unlock
();
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) stopped"
,
p_sys
->
p_codec
->
name
);
}
modules/codec/avcodec/avcodec.h
View file @
dcd503d8
...
@@ -55,6 +55,7 @@ int InitSubtitleDec( decoder_t *, AVCodecContext *, const AVCodec * );
...
@@ -55,6 +55,7 @@ int InitSubtitleDec( decoder_t *, AVCodecContext *, const AVCodec * );
/* Initialize decoder */
/* Initialize decoder */
int
ffmpeg_OpenCodec
(
decoder_t
*
p_dec
);
int
ffmpeg_OpenCodec
(
decoder_t
*
p_dec
);
void
ffmpeg_CloseCodec
(
decoder_t
*
p_dec
);
/*****************************************************************************
/*****************************************************************************
* Module descriptor help strings
* Module descriptor help strings
...
...
modules/codec/avcodec/video.c
View file @
dcd503d8
...
@@ -819,6 +819,8 @@ void EndVideoDec( decoder_t *p_dec )
...
@@ -819,6 +819,8 @@ void EndVideoDec( decoder_t *p_dec )
wait_mt
(
p_sys
);
wait_mt
(
p_sys
);
ffmpeg_CloseCodec
(
p_dec
);
if
(
p_sys
->
p_ff_pic
)
if
(
p_sys
->
p_ff_pic
)
avcodec_free_frame
(
&
p_sys
->
p_ff_pic
);
avcodec_free_frame
(
&
p_sys
->
p_ff_pic
);
...
...
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