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
9a75ace2
Commit
9a75ace2
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3: decode directly to the user-provided AVFrame
parent
0ded61b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
atrac3.c
libavcodec/atrac3.c
+5
-9
No files found.
libavcodec/atrac3.c
View file @
9a75ace2
...
...
@@ -86,7 +86,6 @@ typedef struct ChannelUnit {
}
ChannelUnit
;
typedef
struct
ATRAC3Context
{
AVFrame
frame
;
GetBitContext
gb
;
//@{
/** stream data */
...
...
@@ -798,6 +797,7 @@ static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf,
static
int
atrac3_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
ATRAC3Context
*
q
=
avctx
->
priv_data
;
...
...
@@ -811,8 +811,8 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
q
->
frame
.
nb_samples
=
SAMPLES_PER_FRAME
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
q
->
frame
))
<
0
)
{
frame
->
nb_samples
=
SAMPLES_PER_FRAME
;
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
...
...
@@ -825,14 +825,13 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
databuf
=
buf
;
}
ret
=
decode_frame
(
avctx
,
databuf
,
(
float
**
)
q
->
frame
.
extended_data
);
ret
=
decode_frame
(
avctx
,
databuf
,
(
float
**
)
frame
->
extended_data
);
if
(
ret
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Frame decoding error!
\n
"
);
return
ret
;
}
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
q
->
frame
;
*
got_frame_ptr
=
1
;
return
avctx
->
block_align
;
}
...
...
@@ -986,9 +985,6 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOMEM
);
}
avcodec_get_frame_defaults
(
&
q
->
frame
);
avctx
->
coded_frame
=
&
q
->
frame
;
return
0
;
}
...
...
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