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
64fe3eae
Commit
64fe3eae
authored
Feb 02, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alacenc: do not set bits_per_coded_sample
encoded ALAC does not have a fixed number of bits per sample
parent
43a4cb07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
alacenc.c
libavcodec/alacenc.c
+4
-5
No files found.
libavcodec/alacenc.c
View file @
64fe3eae
...
@@ -393,7 +393,6 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
...
@@ -393,7 +393,6 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
uint8_t
*
alac_extradata
=
av_mallocz
(
ALAC_EXTRADATA_SIZE
+
1
);
uint8_t
*
alac_extradata
=
av_mallocz
(
ALAC_EXTRADATA_SIZE
+
1
);
avctx
->
frame_size
=
DEFAULT_FRAME_SIZE
;
avctx
->
frame_size
=
DEFAULT_FRAME_SIZE
;
avctx
->
bits_per_coded_sample
=
DEFAULT_SAMPLE_SIZE
;
if
(
avctx
->
sample_fmt
!=
AV_SAMPLE_FMT_S16
)
{
if
(
avctx
->
sample_fmt
!=
AV_SAMPLE_FMT_S16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"only pcm_s16 input samples are supported
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"only pcm_s16 input samples are supported
\n
"
);
...
@@ -420,18 +419,18 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
...
@@ -420,18 +419,18 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
s
->
rc
.
k_modifier
=
14
;
s
->
rc
.
k_modifier
=
14
;
s
->
rc
.
rice_modifier
=
4
;
s
->
rc
.
rice_modifier
=
4
;
s
->
max_coded_frame_size
=
8
+
(
avctx
->
frame_size
*
avctx
->
channels
*
avctx
->
bits_per_coded_sample
>>
3
);
s
->
max_coded_frame_size
=
8
+
(
avctx
->
frame_size
*
avctx
->
channels
*
DEFAULT_SAMPLE_SIZE
>>
3
);
s
->
write_sample_size
=
avctx
->
bits_per_coded_sample
+
avctx
->
channels
-
1
;
// FIXME: consider wasted_bytes
s
->
write_sample_size
=
DEFAULT_SAMPLE_SIZE
+
avctx
->
channels
-
1
;
// FIXME: consider wasted_bytes
AV_WB32
(
alac_extradata
,
ALAC_EXTRADATA_SIZE
);
AV_WB32
(
alac_extradata
,
ALAC_EXTRADATA_SIZE
);
AV_WB32
(
alac_extradata
+
4
,
MKBETAG
(
'a'
,
'l'
,
'a'
,
'c'
));
AV_WB32
(
alac_extradata
+
4
,
MKBETAG
(
'a'
,
'l'
,
'a'
,
'c'
));
AV_WB32
(
alac_extradata
+
12
,
avctx
->
frame_size
);
AV_WB32
(
alac_extradata
+
12
,
avctx
->
frame_size
);
AV_WB8
(
alac_extradata
+
17
,
avctx
->
bits_per_coded_sample
);
AV_WB8
(
alac_extradata
+
17
,
DEFAULT_SAMPLE_SIZE
);
AV_WB8
(
alac_extradata
+
21
,
avctx
->
channels
);
AV_WB8
(
alac_extradata
+
21
,
avctx
->
channels
);
AV_WB32
(
alac_extradata
+
24
,
s
->
max_coded_frame_size
);
AV_WB32
(
alac_extradata
+
24
,
s
->
max_coded_frame_size
);
AV_WB32
(
alac_extradata
+
28
,
AV_WB32
(
alac_extradata
+
28
,
avctx
->
sample_rate
*
avctx
->
channels
*
avctx
->
bits_per_coded_sample
);
// average bitrate
avctx
->
sample_rate
*
avctx
->
channels
*
DEFAULT_SAMPLE_SIZE
);
// average bitrate
AV_WB32
(
alac_extradata
+
32
,
avctx
->
sample_rate
);
AV_WB32
(
alac_extradata
+
32
,
avctx
->
sample_rate
);
// Set relevant extradata fields
// Set relevant extradata fields
...
...
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