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
96e39edc
Commit
96e39edc
authored
Jan 17, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify av_fifo_realloc()
Originally committed as revision 7571 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
765d4f3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
fifo.c
libavutil/fifo.c
+7
-11
No files found.
libavutil/fifo.c
View file @
96e39edc
...
...
@@ -60,18 +60,14 @@ void av_fifo_realloc(AVFifoBuffer *f, unsigned int new_size) {
unsigned
int
old_size
=
f
->
end
-
f
->
buffer
;
if
(
old_size
<
new_size
){
uint8_t
*
old
=
f
->
buffer
;
int
len
=
av_fifo_size
(
f
);
AVFifoBuffer
f2
;
f
->
buffer
=
av_realloc
(
f
->
buffer
,
new_size
);
f
->
rptr
+=
f
->
buffer
-
old
;
f
->
wptr
+=
f
->
buffer
-
old
;
if
(
f
->
wptr
<
f
->
rptr
){
memmove
(
f
->
rptr
+
new_size
-
old_size
,
f
->
rptr
,
f
->
buffer
+
old_size
-
f
->
rptr
);
f
->
rptr
+=
new_size
-
old_size
;
}
f
->
end
=
f
->
buffer
+
new_size
;
av_fifo_init
(
&
f2
,
new_size
);
av_fifo_read
(
f
,
f2
.
buffer
,
len
);
f2
.
wptr
+=
len
;
av_free
(
f
->
buffer
);
*
f
=
f2
;
}
}
...
...
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