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
b28851a1
Commit
b28851a1
authored
Jun 03, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alac: frame multi-threading support
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
9684d7f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
alac.c
libavcodec/alac.c
+11
-2
No files found.
libavcodec/alac.c
View file @
b28851a1
...
...
@@ -50,6 +50,7 @@
#include "get_bits.h"
#include "bytestream.h"
#include "internal.h"
#include "thread.h"
#include "unary.h"
#include "mathops.h"
#include "alac_data.h"
...
...
@@ -287,9 +288,10 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
return
AVERROR_INVALIDDATA
;
}
if
(
!
alac
->
nb_samples
)
{
ThreadFrame
tframe
=
{
.
f
=
frame
};
/* get output buffer */
frame
->
nb_samples
=
output_samples
;
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
0
))
<
0
)
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
t
frame
,
0
))
<
0
)
return
ret
;
}
else
if
(
output_samples
!=
alac
->
nb_samples
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"sample count mismatch: %u != %d
\n
"
,
...
...
@@ -616,6 +618,12 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
return
0
;
}
static
int
init_thread_copy
(
AVCodecContext
*
avctx
)
{
ALACContext
*
alac
=
avctx
->
priv_data
;
return
allocate_buffers
(
alac
);
}
AVCodec
ff_alac_decoder
=
{
.
name
=
"alac"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
...
...
@@ -624,6 +632,7 @@ AVCodec ff_alac_decoder = {
.
init
=
alac_decode_init
,
.
close
=
alac_decode_close
,
.
decode
=
alac_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
init_thread_copy
=
init_thread_copy
,
.
capabilities
=
CODEC_CAP_DR1
|
CODEC_CAP_FRAME_THREADS
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ALAC (Apple Lossless Audio Codec)"
),
};
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