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
fd7242dd
Commit
fd7242dd
authored
Jul 20, 2010
by
Pascal Massimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove an unneeded av_realloc()
Originally committed as revision 24375 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
91c4d85f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
libvorbis.c
libavcodec/libvorbis.c
+10
-6
No files found.
libavcodec/libvorbis.c
View file @
fd7242dd
...
...
@@ -85,11 +85,14 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avcco
return
vorbis_encode_setup_init
(
vi
);
}
/* How many bytes are needed for a buffer of length 'l' */
static
int
xiph_len
(
int
l
)
{
return
(
1
+
l
/
255
+
l
);
}
static
av_cold
int
oggvorbis_encode_init
(
AVCodecContext
*
avccontext
)
{
OggVorbisContext
*
context
=
avccontext
->
priv_data
;
ogg_packet
header
,
header_comm
,
header_code
;
uint8_t
*
p
;
unsigned
int
offset
,
len
;
unsigned
int
offset
;
vorbis_info_init
(
&
context
->
vi
)
;
if
(
oggvorbis_init_encoder
(
&
context
->
vi
,
avccontext
)
<
0
)
{
...
...
@@ -105,9 +108,11 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) {
vorbis_analysis_headerout
(
&
context
->
vd
,
&
context
->
vc
,
&
header
,
&
header_comm
,
&
header_code
);
len
=
header
.
bytes
+
header_comm
.
bytes
+
header_code
.
bytes
;
avccontext
->
extradata_size
=
64
+
len
+
len
/
255
;
p
=
avccontext
->
extradata
=
av_mallocz
(
avccontext
->
extradata_size
);
avccontext
->
extradata_size
=
1
+
xiph_len
(
header
.
bytes
)
+
xiph_len
(
header_comm
.
bytes
)
+
header_code
.
bytes
;
p
=
avccontext
->
extradata
=
av_malloc
(
avccontext
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
p
[
0
]
=
2
;
offset
=
1
;
offset
+=
av_xiphlacing
(
&
p
[
offset
],
header
.
bytes
);
...
...
@@ -118,8 +123,7 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) {
offset
+=
header_comm
.
bytes
;
memcpy
(
&
p
[
offset
],
header_code
.
packet
,
header_code
.
bytes
);
offset
+=
header_code
.
bytes
;
avccontext
->
extradata_size
=
offset
;
avccontext
->
extradata
=
av_realloc
(
avccontext
->
extradata
,
avccontext
->
extradata_size
);
assert
(
offset
==
avccontext
->
extradata_size
);
/* vorbis_block_clear(&context->vb);
vorbis_dsp_clear(&context->vd);
...
...
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