Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
8257b835
Commit
8257b835
authored
16 years ago
by
Stefano Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
Implement av_fifo_realloc2().
Originally committed as revision 14846 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e13894e8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavutil/avutil.h
+1
-1
1 addition, 1 deletion
libavutil/avutil.h
libavutil/fifo.c
+7
-1
7 additions, 1 deletion
libavutil/fifo.c
libavutil/fifo.h
+9
-0
9 additions, 0 deletions
libavutil/fifo.h
with
17 additions
and
2 deletions
libavutil/avutil.h
+
1
−
1
View file @
8257b835
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 49
#define LIBAVUTIL_VERSION_MAJOR 49
#define LIBAVUTIL_VERSION_MINOR
9
#define LIBAVUTIL_VERSION_MINOR
10
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
This diff is collapsed.
Click to expand it.
libavutil/fifo.c
+
7
−
1
View file @
8257b835
...
@@ -55,18 +55,24 @@ int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
...
@@ -55,18 +55,24 @@ int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
* Resizes a FIFO.
* Resizes a FIFO.
*/
*/
void
av_fifo_realloc
(
AVFifoBuffer
*
f
,
unsigned
int
new_size
)
{
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
;
unsigned
int
old_size
=
f
->
end
-
f
->
buffer
;
if
(
old_size
<=
new_size
){
if
(
old_size
<=
new_size
){
int
len
=
av_fifo_size
(
f
);
int
len
=
av_fifo_size
(
f
);
AVFifoBuffer
f2
;
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
);
av_fifo_read
(
f
,
f2
.
buffer
,
len
);
f2
.
wptr
+=
len
;
f2
.
wptr
+=
len
;
av_free
(
f
->
buffer
);
av_free
(
f
->
buffer
);
*
f
=
f2
;
*
f
=
f2
;
}
}
return
0
;
}
}
void
av_fifo_write
(
AVFifoBuffer
*
f
,
const
uint8_t
*
buf
,
int
size
)
void
av_fifo_write
(
AVFifoBuffer
*
f
,
const
uint8_t
*
buf
,
int
size
)
...
...
This diff is collapsed.
Click to expand it.
libavutil/fifo.h
+
9
−
0
View file @
8257b835
...
@@ -97,9 +97,18 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
...
@@ -97,9 +97,18 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
* Resizes an AVFifoBuffer.
* Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
* @param size new AVFifoBuffer size in bytes
* @see av_fifo_realloc2()
*/
*/
void
av_fifo_realloc
(
AVFifoBuffer
*
f
,
unsigned
int
size
);
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.
* Reads and discards the specified amount of data from an AVFifoBuffer.
* @param *f AVFifoBuffer to read from
* @param *f AVFifoBuffer to read from
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment