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
d7169280
Commit
d7169280
authored
Dec 05, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frame_thread_encoder: fix locking while locks are held
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
bde6f6ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
utils.c
libavcodec/utils.c
+4
-4
No files found.
libavcodec/utils.c
View file @
d7169280
...
...
@@ -898,9 +898,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
av_log
(
avctx
,
AV_LOG_WARNING
,
"Warning: not compiled with thread support, using thread emulation
\n
"
);
if
(
HAVE_THREADS
)
{
entangled_thread_counter
--
;
//we will instanciate a few encoders thus kick the counter to prevent false detection of a problem
ff_unlock_avcodec
()
;
//we will instanciate a few encoders thus kick the counter to prevent false detection of a problem
ret
=
ff_frame_thread_encoder_init
(
avctx
,
options
?
*
options
:
NULL
);
entangled_thread_counter
++
;
ff_lock_avcodec
(
avctx
)
;
if
(
ret
<
0
)
goto
free_and_end
;
}
...
...
@@ -1874,9 +1874,9 @@ av_cold int avcodec_close(AVCodecContext *avctx)
if
(
avcodec_is_open
(
avctx
))
{
if
(
HAVE_THREADS
&&
avctx
->
internal
->
frame_thread_encoder
&&
avctx
->
thread_count
>
1
)
{
entangled_thread_counter
--
;
ff_unlock_avcodec
()
;
ff_frame_thread_encoder_free
(
avctx
);
entangled_thread_counter
++
;
ff_lock_avcodec
(
avctx
)
;
}
if
(
HAVE_THREADS
&&
avctx
->
thread_opaque
)
ff_thread_free
(
avctx
);
...
...
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