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
79b0b66b
Commit
79b0b66b
authored
Feb 08, 2006
by
Måns Rullgård
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode adts aac streams
Originally committed as revision 4953 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
6ee66973
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
faad.c
libavcodec/faad.c
+26
-10
No files found.
libavcodec/faad.c
View file @
79b0b66b
...
...
@@ -49,9 +49,8 @@ static const char* libfaadname = "libfaad.so.0";
typedef
struct
{
void
*
handle
;
/* dlopen handle */
void
*
faac_handle
;
/* FAAD library handle */
int
frame_size
;
int
sample_size
;
int
flags
;
int
init
;
/* faad calls */
faacDecHandle
FAADAPI
(
*
faacDecOpen
)(
void
);
...
...
@@ -111,17 +110,20 @@ static int faac_init_mp4(AVCodecContext *avctx)
#endif
int
r
=
0
;
if
(
avctx
->
extradata
)
if
(
avctx
->
extradata
)
{
r
=
s
->
faacDecInit2
(
s
->
faac_handle
,
(
uint8_t
*
)
avctx
->
extradata
,
avctx
->
extradata_size
,
&
samplerate
,
&
channels
);
// else r = s->faacDecInit(s->faac_handle ... );
if
(
r
<
0
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"faacDecInit2 failed r:%d sr:%ld ch:%ld s:%d
\n
"
,
r
,
samplerate
,
(
long
)
channels
,
avctx
->
extradata_size
);
avctx
->
sample_rate
=
samplerate
;
avctx
->
channels
=
channels
;
if
(
r
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"faacDecInit2 failed r:%d sr:%ld ch:%ld s:%d
\n
"
,
r
,
samplerate
,
(
long
)
channels
,
avctx
->
extradata_size
);
}
else
{
avctx
->
sample_rate
=
samplerate
;
avctx
->
channels
=
channels
;
s
->
init
=
1
;
}
}
return
r
;
}
...
...
@@ -155,6 +157,20 @@ static int faac_decode_frame(AVCodecContext *avctx,
?
buf_size
:
(
int
)
bytesconsumed
;
#else
if
(
!
s
->
init
){
unsigned
long
srate
;
unsigned
char
channels
;
int
r
=
faacDecInit
(
s
->
faac_handle
,
buf
,
buf_size
,
&
srate
,
&
channels
);
if
(
r
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"faac: codec init failed: %s
\n
"
,
s
->
faacDecGetErrorMessage
(
frame_info
.
error
));
return
0
;
}
avctx
->
sample_rate
=
srate
;
avctx
->
channels
=
channels
;
s
->
init
=
1
;
}
out
=
s
->
faacDecDecode
(
s
->
faac_handle
,
&
frame_info
,
(
unsigned
char
*
)
buf
,
(
unsigned
long
)
buf_size
);
if
(
frame_info
.
error
>
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