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
197bbcf4
Commit
197bbcf4
authored
Sep 16, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3enc: move mp3_update_xing() down
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f276a490
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
mp3enc.c
libavformat/mp3enc.c
+26
-26
No files found.
libavformat/mp3enc.c
View file @
197bbcf4
...
...
@@ -255,32 +255,6 @@ static void mp3_xing_add_frame(MP3Context *mp3, AVPacket *pkt)
}
}
static
void
mp3_update_xing
(
AVFormatContext
*
s
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
int
i
;
/* replace "Xing" identification string with "Info" for CBR files. */
if
(
!
mp3
->
has_variable_bitrate
)
{
avio_seek
(
s
->
pb
,
mp3
->
xing_offset
,
SEEK_SET
);
ffio_wfourcc
(
s
->
pb
,
"Info"
);
}
avio_seek
(
s
->
pb
,
mp3
->
xing_offset
+
8
,
SEEK_SET
);
avio_wb32
(
s
->
pb
,
mp3
->
frames
);
avio_wb32
(
s
->
pb
,
mp3
->
size
);
avio_w8
(
s
->
pb
,
0
);
// first toc entry has to be zero.
for
(
i
=
1
;
i
<
XING_TOC_SIZE
;
++
i
)
{
int
j
=
i
*
mp3
->
pos
/
XING_TOC_SIZE
;
int
seek_point
=
256LL
*
mp3
->
bag
[
j
]
/
mp3
->
size
;
avio_w8
(
s
->
pb
,
FFMIN
(
seek_point
,
255
));
}
avio_seek
(
s
->
pb
,
0
,
SEEK_END
);
}
static
int
mp3_write_audio_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
...
...
@@ -341,6 +315,32 @@ static int mp3_queue_flush(AVFormatContext *s)
return
ret
;
}
static
void
mp3_update_xing
(
AVFormatContext
*
s
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
int
i
;
/* replace "Xing" identification string with "Info" for CBR files. */
if
(
!
mp3
->
has_variable_bitrate
)
{
avio_seek
(
s
->
pb
,
mp3
->
xing_offset
,
SEEK_SET
);
ffio_wfourcc
(
s
->
pb
,
"Info"
);
}
avio_seek
(
s
->
pb
,
mp3
->
xing_offset
+
8
,
SEEK_SET
);
avio_wb32
(
s
->
pb
,
mp3
->
frames
);
avio_wb32
(
s
->
pb
,
mp3
->
size
);
avio_w8
(
s
->
pb
,
0
);
// first toc entry has to be zero.
for
(
i
=
1
;
i
<
XING_TOC_SIZE
;
++
i
)
{
int
j
=
i
*
mp3
->
pos
/
XING_TOC_SIZE
;
int
seek_point
=
256LL
*
mp3
->
bag
[
j
]
/
mp3
->
size
;
avio_w8
(
s
->
pb
,
FFMIN
(
seek_point
,
255
));
}
avio_seek
(
s
->
pb
,
0
,
SEEK_END
);
}
static
int
mp2_write_trailer
(
struct
AVFormatContext
*
s
)
{
uint8_t
buf
[
ID3v1_TAG_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