Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
20ea8bf9
Commit
20ea8bf9
authored
Feb 09, 2017
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac_latm: Copy whole AudioSpecificConfig when it is sized.
This preserves sync extensions.
parent
3f1a38c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
aacdec.c
libavcodec/aacdec.c
+15
-12
No files found.
libavcodec/aacdec.c
View file @
20ea8bf9
...
@@ -289,17 +289,19 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
...
@@ -289,17 +289,19 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
int
sync_extension
=
0
;
int
sync_extension
=
0
;
int
bits_consumed
,
esize
,
i
;
int
bits_consumed
,
esize
,
i
;
if
(
asclen
)
{
if
(
asclen
>
0
)
{
sync_extension
=
1
;
sync_extension
=
1
;
asclen
=
FFMIN
(
asclen
,
get_bits_left
(
gb
));
asclen
=
FFMIN
(
asclen
,
get_bits_left
(
gb
));
}
else
init_get_bits
(
&
gbc
,
gb
->
buffer
,
config_start_bit
+
asclen
);
asclen
=
get_bits_left
(
gb
);
skip_bits_long
(
&
gbc
,
config_start_bit
);
}
else
if
(
asclen
==
0
)
{
if
(
asclen
<=
0
)
gbc
=
*
gb
;
}
else
{
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
i
nit_get_bits
(
&
gbc
,
gb
->
buffer
,
config_start_bit
+
asclen
);
i
f
(
get_bits_left
(
gb
)
<=
0
)
skip_bits_long
(
&
gbc
,
config_start_bit
)
;
return
AVERROR_INVALIDDATA
;
bits_consumed
=
decode_audio_specific_config_gb
(
NULL
,
avctx
,
&
m4ac
,
bits_consumed
=
decode_audio_specific_config_gb
(
NULL
,
avctx
,
&
m4ac
,
&
gbc
,
config_start_bit
,
&
gbc
,
config_start_bit
,
...
@@ -309,6 +311,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
...
@@ -309,6 +311,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
bits_consumed
-=
config_start_bit
;
bits_consumed
-=
config_start_bit
;
if
(
asclen
==
0
)
asclen
=
bits_consumed
;
if
(
!
latmctx
->
initialized
||
if
(
!
latmctx
->
initialized
||
ac
->
oc
[
1
].
m4ac
.
sample_rate
!=
m4ac
.
sample_rate
||
ac
->
oc
[
1
].
m4ac
.
sample_rate
!=
m4ac
.
sample_rate
||
ac
->
oc
[
1
].
m4ac
.
chan_config
!=
m4ac
.
chan_config
)
{
ac
->
oc
[
1
].
m4ac
.
chan_config
!=
m4ac
.
chan_config
)
{
...
@@ -320,7 +325,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
...
@@ -320,7 +325,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
}
}
latmctx
->
initialized
=
0
;
latmctx
->
initialized
=
0
;
esize
=
(
bits_consumed
+
7
)
/
8
;
esize
=
(
asclen
+
7
)
/
8
;
if
(
avctx
->
extradata_size
<
esize
)
{
if
(
avctx
->
extradata_size
<
esize
)
{
av_free
(
avctx
->
extradata
);
av_free
(
avctx
->
extradata
);
...
@@ -336,9 +341,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
...
@@ -336,9 +341,9 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
}
}
memset
(
avctx
->
extradata
+
esize
,
0
,
AV_INPUT_BUFFER_PADDING_SIZE
);
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
,
static
int
read_stream_mux_config
(
struct
LATMContext
*
latmctx
,
...
@@ -379,8 +384,6 @@ 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
);
int
ascLen
=
latm_get_value
(
gb
);
if
((
ret
=
latm_decode_audio_specific_config
(
latmctx
,
gb
,
ascLen
))
<
0
)
if
((
ret
=
latm_decode_audio_specific_config
(
latmctx
,
gb
,
ascLen
))
<
0
)
return
ret
;
return
ret
;
ascLen
-=
ret
;
skip_bits_long
(
gb
,
ascLen
);
}
}
latmctx
->
frame_length_type
=
get_bits
(
gb
,
3
);
latmctx
->
frame_length_type
=
get_bits
(
gb
,
3
);
...
...
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