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
0588935e
Commit
0588935e
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adx: decode directly to the user-provided AVFrame
parent
e57daa87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
adxdec.c
libavcodec/adxdec.c
+5
-8
No files found.
libavcodec/adxdec.c
View file @
0588935e
...
...
@@ -52,9 +52,6 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16P
;
avcodec_get_frame_defaults
(
&
c
->
frame
);
avctx
->
coded_frame
=
&
c
->
frame
;
return
0
;
}
...
...
@@ -98,6 +95,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
static
int
adx_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
int
buf_size
=
avpkt
->
size
;
ADXContext
*
c
=
avctx
->
priv_data
;
int16_t
**
samples
;
...
...
@@ -142,12 +140,12 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
c
->
frame
.
nb_samples
=
num_blocks
*
BLOCK_SAMPLES
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
c
->
frame
))
<
0
)
{
frame
->
nb_samples
=
num_blocks
*
BLOCK_SAMPLES
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
samples
=
(
int16_t
**
)
c
->
frame
.
extended_data
;
samples
=
(
int16_t
**
)
frame
->
extended_data
;
samples_offset
=
0
;
while
(
num_blocks
--
)
{
...
...
@@ -164,7 +162,6 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
c
->
frame
;
return
buf
-
avpkt
->
data
;
}
...
...
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