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
57d5a224
Commit
57d5a224
authored
Jul 04, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3enc: add lame tag with start padding info
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7b521c52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
mp3dec.c
libavformat/mp3dec.c
+1
-1
mp3enc.c
libavformat/mp3enc.c
+10
-1
mp3
tests/ref/lavf-fate/mp3
+1
-1
No files found.
libavformat/mp3dec.c
View file @
57d5a224
...
...
@@ -116,7 +116,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
avio_skip
(
s
->
pb
,
4
);
v
=
avio_rb32
(
s
->
pb
);
if
(
v
==
MKBETAG
(
'L'
,
'A'
,
'M'
,
'E'
))
{
if
(
v
==
MKBETAG
(
'L'
,
'A'
,
'M'
,
'E'
)
||
v
==
MKBETAG
(
'L'
,
'a'
,
'v'
,
'f'
)
)
{
avio_skip
(
s
->
pb
,
21
-
4
);
v
=
avio_rb24
(
s
->
pb
);
mp3
->
start_pad
=
v
>>
12
;
...
...
libavformat/mp3enc.c
View file @
57d5a224
...
...
@@ -123,6 +123,7 @@ static int mp3_write_xing(AVFormatContext *s)
MPADecodeHeader
c
;
int
srate_idx
,
ver
=
0
,
i
,
channels
;
int
needed
;
const
char
*
vendor
=
(
codec
->
flags
&
CODEC_FLAG_BITEXACT
)
?
"Lavf"
:
LIBAVFORMAT_IDENT
;
if
(
!
s
->
pb
->
seekable
)
return
0
;
...
...
@@ -177,7 +178,9 @@ static int mp3_write_xing(AVFormatContext *s)
+
4
// frames/size/toc flags
+
4
// frames
+
4
// size
+
VBR_TOC_SIZE
;
// toc
+
VBR_TOC_SIZE
// toc
+
24
;
if
(
needed
<=
c
.
frame_size
)
break
;
...
...
@@ -202,6 +205,12 @@ static int mp3_write_xing(AVFormatContext *s)
for
(
i
=
0
;
i
<
VBR_TOC_SIZE
;
++
i
)
avio_w8
(
s
->
pb
,
(
uint8_t
)(
255
*
i
/
VBR_TOC_SIZE
));
for
(
i
=
0
;
i
<
strlen
(
vendor
);
++
i
)
avio_w8
(
s
->
pb
,
vendor
[
i
]);
for
(;
i
<
21
;
++
i
)
avio_w8
(
s
->
pb
,
0
);
avio_wb24
(
s
->
pb
,
FFMAX
(
codec
->
delay
-
528
-
1
,
0
)
<<
12
);
ffio_fill
(
s
->
pb
,
0
,
c
.
frame_size
-
needed
);
avio_flush
(
s
->
pb
);
...
...
tests/ref/lavf-fate/mp3
View file @
57d5a224
67cbcc79f018afb68f7d81625bfa234c
*./tests/data/lavf-fate/lavf.mp3
40a4e41ae74ec8dacdf02402831a6a58
*./tests/data/lavf-fate/lavf.mp3
97230 ./tests/data/lavf-fate/lavf.mp3
./tests/data/lavf-fate/lavf.mp3 CRC=0x6c9850fe
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