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
d268b79e
Commit
d268b79e
authored
Oct 22, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac_latm: reconfigure decoder on audio specific config changes
parent
fd095539
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
aacdec.c
libavcodec/aacdec.c
+15
-10
No files found.
libavcodec/aacdec.c
View file @
d268b79e
...
...
@@ -2319,8 +2319,9 @@ static inline uint32_t latm_get_value(GetBitContext *b)
static
int
latm_decode_audio_specific_config
(
struct
LATMContext
*
latmctx
,
GetBitContext
*
gb
,
int
asclen
)
{
AVCodecContext
*
avctx
=
latmctx
->
aac_ctx
.
avctx
;
MPEG4AudioConfig
m4ac
;
AACContext
*
ac
=
&
latmctx
->
aac_ctx
;
AVCodecContext
*
avctx
=
ac
->
avctx
;
MPEG4AudioConfig
m4ac
=
{
0
};
int
config_start_bit
=
get_bits_count
(
gb
);
int
sync_extension
=
0
;
int
bits_consumed
,
esize
;
...
...
@@ -2335,18 +2336,23 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
av_log_missing_feature
(
latmctx
->
aac_ctx
.
avctx
,
"audio specific "
"config not byte aligned.
\n
"
,
1
);
return
AVERROR_INVALIDDATA
;
}
else
{
bits_consumed
=
decode_audio_specific_config
(
NULL
,
avctx
,
&
m4ac
,
}
bits_consumed
=
decode_audio_specific_config
(
NULL
,
avctx
,
&
m4ac
,
gb
->
buffer
+
(
config_start_bit
/
8
),
asclen
,
sync_extension
);
if
(
bits_consumed
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
ac
->
m4ac
.
sample_rate
!=
m4ac
.
sample_rate
||
ac
->
m4ac
.
chan_config
!=
m4ac
.
chan_config
)
{
av_log
(
avctx
,
AV_LOG_INFO
,
"audio config changed
\n
"
);
latmctx
->
initialized
=
0
;
esize
=
(
bits_consumed
+
7
)
/
8
;
if
(
avctx
->
extradata_size
<
=
esize
)
{
if
(
avctx
->
extradata_size
<
esize
)
{
av_free
(
avctx
->
extradata
);
avctx
->
extradata
=
av_malloc
(
esize
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
avctx
->
extradata
)
...
...
@@ -2356,9 +2362,8 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
avctx
->
extradata_size
=
esize
;
memcpy
(
avctx
->
extradata
,
gb
->
buffer
+
(
config_start_bit
/
8
),
esize
);
memset
(
avctx
->
extradata
+
esize
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
skip_bits_long
(
gb
,
bits_consumed
);
}
skip_bits_long
(
gb
,
bits_consumed
);
return
bits_consumed
;
}
...
...
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