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
8257b835
Commit
8257b835
authored
Aug 19, 2008
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement av_fifo_realloc2().
Originally committed as revision 14846 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e13894e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
avutil.h
libavutil/avutil.h
+1
-1
fifo.c
libavutil/fifo.c
+7
-1
fifo.h
libavutil/fifo.h
+9
-0
No files found.
libavutil/avutil.h
View file @
8257b835
...
...
@@ -35,7 +35,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 49
#define LIBAVUTIL_VERSION_MINOR
9
#define LIBAVUTIL_VERSION_MINOR
10
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
libavutil/fifo.c
View file @
8257b835
...
...
@@ -55,18 +55,24 @@ int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
* Resizes a FIFO.
*/
void
av_fifo_realloc
(
AVFifoBuffer
*
f
,
unsigned
int
new_size
)
{
av_fifo_realloc2
(
f
,
new_size
);
}
int
av_fifo_realloc2
(
AVFifoBuffer
*
f
,
unsigned
int
new_size
)
{
unsigned
int
old_size
=
f
->
end
-
f
->
buffer
;
if
(
old_size
<=
new_size
){
int
len
=
av_fifo_size
(
f
);
AVFifoBuffer
f2
;
av_fifo_init
(
&
f2
,
new_size
);
if
(
av_fifo_init
(
&
f2
,
new_size
)
<
0
)
return
-
1
;
av_fifo_read
(
f
,
f2
.
buffer
,
len
);
f2
.
wptr
+=
len
;
av_free
(
f
->
buffer
);
*
f
=
f2
;
}
return
0
;
}
void
av_fifo_write
(
AVFifoBuffer
*
f
,
const
uint8_t
*
buf
,
int
size
)
...
...
libavutil/fifo.h
View file @
8257b835
...
...
@@ -97,9 +97,18 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
* Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
* @see av_fifo_realloc2()
*/
void
av_fifo_realloc
(
AVFifoBuffer
*
f
,
unsigned
int
size
);
/**
* Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
* @return <0 for failure >=0 otherwise
*/
int
av_fifo_realloc2
(
AVFifoBuffer
*
f
,
unsigned
int
size
);
/**
* Reads and discards the specified amount of data from an AVFifoBuffer.
* @param *f AVFifoBuffer to read from
...
...
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