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
2d56f0d0
Commit
2d56f0d0
authored
May 26, 2014
by
Carl Eugen Hoyos
Committed by
Michael Niedermayer
May 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write the actual mp3 frame size when muxing into caf if available.
Fixes ticket #3648.
parent
2db89765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
cafenc.c
libavformat/cafenc.c
+5
-1
No files found.
libavformat/cafenc.c
View file @
2d56f0d0
...
...
@@ -107,6 +107,7 @@ static int caf_write_header(AVFormatContext *s)
AVDictionaryEntry
*
t
=
NULL
;
unsigned
int
codec_tag
=
ff_codec_get_tag
(
ff_codec_caf_tags
,
enc
->
codec_id
);
int64_t
chunk_size
=
0
;
int
frame_size
=
enc
->
frame_size
;
if
(
s
->
nb_streams
!=
1
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"CAF files have exactly one stream
\n
"
);
...
...
@@ -144,6 +145,9 @@ static int caf_write_header(AVFormatContext *s)
return
AVERROR_INVALIDDATA
;
}
if
(
enc
->
codec_id
!=
AV_CODEC_ID_MP3
||
frame_size
!=
576
)
frame_size
=
samples_per_packet
(
enc
->
codec_id
,
enc
->
channels
);
ffio_wfourcc
(
pb
,
"caff"
);
//< mFileType
avio_wb16
(
pb
,
1
);
//< mFileVersion
avio_wb16
(
pb
,
0
);
//< mFileFlags
...
...
@@ -154,7 +158,7 @@ static int caf_write_header(AVFormatContext *s)
avio_wl32
(
pb
,
codec_tag
);
//< mFormatID
avio_wb32
(
pb
,
codec_flags
(
enc
->
codec_id
));
//< mFormatFlags
avio_wb32
(
pb
,
enc
->
block_align
);
//< mBytesPerPacket
avio_wb32
(
pb
,
samples_per_packet
(
enc
->
codec_id
,
enc
->
channels
));
//< mFramesPerPacket
avio_wb32
(
pb
,
frame_size
);
//< mFramesPerPacket
avio_wb32
(
pb
,
enc
->
channels
);
//< mChannelsPerFrame
avio_wb32
(
pb
,
av_get_bits_per_sample
(
enc
->
codec_id
));
//< mBitsPerChannel
...
...
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