Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
42ee3898
Commit
42ee3898
authored
Dec 03, 2020
by
Andreas Rheinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ac3dec: Make decoders init-threadsafe
Signed-off-by:
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
parent
10663312
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
ac3dec.c
libavcodec/ac3dec.c
+4
-1
ac3dec_fixed.c
libavcodec/ac3dec_fixed.c
+1
-1
ac3dec_float.c
libavcodec/ac3dec_float.c
+2
-2
No files found.
libavcodec/ac3dec.c
View file @
42ee3898
...
...
@@ -33,6 +33,7 @@
#include "libavutil/crc.h"
#include "libavutil/downmix_info.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "bswapdsp.h"
#include "internal.h"
#include "aac_ac3_parser.h"
...
...
@@ -183,12 +184,12 @@ static av_cold void ac3_tables_init(void)
*/
static
av_cold
int
ac3_decode_init
(
AVCodecContext
*
avctx
)
{
static
AVOnce
init_static_once
=
AV_ONCE_INIT
;
AC3DecodeContext
*
s
=
avctx
->
priv_data
;
int
i
,
ret
;
s
->
avctx
=
avctx
;
ac3_tables_init
();
if
((
ret
=
ff_mdct_init
(
&
s
->
imdct_256
,
8
,
1
,
1
.
0
))
<
0
||
(
ret
=
ff_mdct_init
(
&
s
->
imdct_512
,
9
,
1
,
1
.
0
))
<
0
)
return
ret
;
...
...
@@ -226,6 +227,8 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
s
->
dlyptr
[
i
]
=
s
->
delay
[
i
];
}
ff_thread_once
(
&
init_static_once
,
ac3_tables_init
);
return
0
;
}
...
...
libavcodec/ac3dec_fixed.c
View file @
42ee3898
...
...
@@ -182,5 +182,5 @@ AVCodec ff_ac3_fixed_decoder = {
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16P
,
AV_SAMPLE_FMT_NONE
},
.
priv_class
=
&
ac3_decoder_class
,
.
caps_internal
=
FF_CODEC_CAP_INIT_CLEANUP
,
.
caps_internal
=
FF_CODEC_CAP_INIT_
THREADSAFE
|
FF_CODEC_CAP_INIT_
CLEANUP
,
};
libavcodec/ac3dec_float.c
View file @
42ee3898
...
...
@@ -67,7 +67,7 @@ AVCodec ff_ac3_decoder = {
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
},
.
priv_class
=
&
ac3_decoder_class
,
.
caps_internal
=
FF_CODEC_CAP_INIT_CLEANUP
,
.
caps_internal
=
FF_CODEC_CAP_INIT_
THREADSAFE
|
FF_CODEC_CAP_INIT_
CLEANUP
,
};
#if CONFIG_EAC3_DECODER
...
...
@@ -92,6 +92,6 @@ AVCodec ff_eac3_decoder = {
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_FLTP
,
AV_SAMPLE_FMT_NONE
},
.
priv_class
=
&
eac3_decoder_class
,
.
caps_internal
=
FF_CODEC_CAP_INIT_CLEANUP
,
.
caps_internal
=
FF_CODEC_CAP_INIT_
THREADSAFE
|
FF_CODEC_CAP_INIT_
CLEANUP
,
};
#endif
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