Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
20ea8bf9
Commit
20ea8bf9
authored
8 years ago
by
Alex Converse
Browse files
Options
Downloads
Patches
Plain Diff
aac_latm: Copy whole AudioSpecificConfig when it is sized.
This preserves sync extensions.
parent
3f1a38c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/aacdec.c
+15
-12
15 additions, 12 deletions
libavcodec/aacdec.c
with
15 additions
and
12 deletions
libavcodec/aacdec.c
+
15
−
12
View file @
20ea8bf9
...
...
@@ -289,17 +289,19 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
int
sync_extension
=
0
;
int
bits_consumed
,
esize
,
i
;
if
(
asclen
)
{
if
(
asclen
>
0
)
{
sync_extension
=
1
;
asclen
=
FFMIN
(
asclen
,
get_bits_left
(
gb
));
}
else
asclen
=
get_bits_left
(
gb
);
if
(
asclen
<=
0
)
init_get_bits
(
&
gbc
,
gb
->
buffer
,
config_start_bit
+
asclen
);
skip_bits_long
(
&
gbc
,
config_start_bit
);
}
else
if
(
asclen
==
0
)
{
gbc
=
*
gb
;
}
else
{
return
AVERROR_INVALIDDATA
;
}
i
nit_
get_bits
(
&
gbc
,
gb
->
buffer
,
config_start_bit
+
asclen
);
skip_bits_long
(
&
gbc
,
config_start_bit
)
;
i
f
(
get_bits
_left
(
gb
)
<=
0
)
return
AVERROR_INVALIDDATA
;
bits_consumed
=
decode_audio_specific_config_gb
(
NULL
,
avctx
,
&
m4ac
,
&
gbc
,
config_start_bit
,
...
...
@@ -309,6 +311,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
return
AVERROR_INVALIDDATA
;
bits_consumed
-=
config_start_bit
;
if
(
asclen
==
0
)
asclen
=
bits_consumed
;
if
(
!
latmctx
->
initialized
||
ac
->
oc
[
1
].
m4ac
.
sample_rate
!=
m4ac
.
sample_rate
||
ac
->
oc
[
1
].
m4ac
.
chan_config
!=
m4ac
.
chan_config
)
{
...
...
@@ -320,7 +325,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
}
latmctx
->
initialized
=
0
;
esize
=
(
bits_consumed
+
7
)
/
8
;
esize
=
(
asclen
+
7
)
/
8
;
if
(
avctx
->
extradata_size
<
esize
)
{
av_free
(
avctx
->
extradata
);
...
...
@@ -336,9 +341,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
}
memset
(
avctx
->
extradata
+
esize
,
0
,
AV_INPUT_BUFFER_PADDING_SIZE
);
}
skip_bits_long
(
gb
,
bits_consumed
);
skip_bits_long
(
gb
,
asclen
);
return
bits_consumed
;
return
0
;
}
static
int
read_stream_mux_config
(
struct
LATMContext
*
latmctx
,
...
...
@@ -379,8 +384,6 @@ static int read_stream_mux_config(struct LATMContext *latmctx,
int
ascLen
=
latm_get_value
(
gb
);
if
((
ret
=
latm_decode_audio_specific_config
(
latmctx
,
gb
,
ascLen
))
<
0
)
return
ret
;
ascLen
-=
ret
;
skip_bits_long
(
gb
,
ascLen
);
}
latmctx
->
frame_length_type
=
get_bits
(
gb
,
3
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment