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
9644fc95
Commit
9644fc95
authored
Jun 07, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
matroskadec: move ALAC extradata creation bellow AAC one
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
33fb22f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
matroskadec.c
libavformat/matroskadec.c
+13
-12
No files found.
libavformat/matroskadec.c
View file @
9644fc95
...
...
@@ -1684,18 +1684,6 @@ static int matroska_read_header(AVFormatContext *s)
&&
(
track
->
codec_priv
.
data
!=
NULL
))
{
fourcc
=
AV_RL32
(
track
->
codec_priv
.
data
);
codec_id
=
ff_codec_get_id
(
ff_codec_movvideo_tags
,
fourcc
);
}
else
if
(
codec_id
==
AV_CODEC_ID_ALAC
&&
track
->
codec_priv
.
size
&&
track
->
codec_priv
.
size
<
INT_MAX
-
12
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
/* Only ALAC's magic cookie is stored in Matroska's track headers.
Create the "atom size", "tag", and "tag version" fields the
decoder expects manually. */
extradata_size
=
12
+
track
->
codec_priv
.
size
;
extradata
=
av_mallocz
(
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
extradata
==
NULL
)
return
AVERROR
(
ENOMEM
);
AV_WB32
(
extradata
,
extradata_size
);
memcpy
(
&
extradata
[
4
],
"alac"
,
4
);
AV_WB32
(
&
extradata
[
8
],
0
);
memcpy
(
&
extradata
[
12
],
track
->
codec_priv
.
data
,
track
->
codec_priv
.
size
);
}
else
if
(
codec_id
==
AV_CODEC_ID_PCM_S16BE
)
{
switch
(
track
->
audio
.
bitdepth
)
{
case
8
:
codec_id
=
AV_CODEC_ID_PCM_U8
;
break
;
...
...
@@ -1726,6 +1714,19 @@ static int matroska_read_header(AVFormatContext *s)
extradata_size
=
5
;
}
else
extradata_size
=
2
;
}
else
if
(
codec_id
==
AV_CODEC_ID_ALAC
&&
track
->
codec_priv
.
size
&&
track
->
codec_priv
.
size
<
INT_MAX
-
12
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
/* Only ALAC's magic cookie is stored in Matroska's track headers.
Create the "atom size", "tag", and "tag version" fields the
decoder expects manually. */
extradata_size
=
12
+
track
->
codec_priv
.
size
;
extradata
=
av_mallocz
(
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
extradata
==
NULL
)
return
AVERROR
(
ENOMEM
);
AV_WB32
(
extradata
,
extradata_size
);
memcpy
(
&
extradata
[
4
],
"alac"
,
4
);
AV_WB32
(
&
extradata
[
8
],
0
);
memcpy
(
&
extradata
[
12
],
track
->
codec_priv
.
data
,
track
->
codec_priv
.
size
);
}
else
if
(
codec_id
==
AV_CODEC_ID_TTA
)
{
extradata_size
=
30
;
extradata
=
av_mallocz
(
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
...
...
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