You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
fifo: K&R formatting cosmetics
This commit is contained in:
@@ -59,7 +59,8 @@ int av_fifo_space(AVFifoBuffer *f)
|
||||
return f->end - f->buffer - av_fifo_size(f);
|
||||
}
|
||||
|
||||
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int 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) {
|
||||
@@ -78,8 +79,10 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// src must NOT be const as it can be a context for func that may need updating (like a pointer or byte counter)
|
||||
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int))
|
||||
/* src must NOT be const as it can be a context for func that may need
|
||||
* updating (like a pointer or byte counter) */
|
||||
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size,
|
||||
int (*func)(void *, void *, int))
|
||||
{
|
||||
int total = size;
|
||||
do {
|
||||
@@ -101,13 +104,14 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
|
||||
return total - size;
|
||||
}
|
||||
|
||||
|
||||
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int))
|
||||
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size,
|
||||
void (*func)(void *, void *, int))
|
||||
{
|
||||
// Read memory barrier needed for SMP here in theory
|
||||
do {
|
||||
int len = FFMIN(f->end - f->rptr, buf_size);
|
||||
if(func) func(dest, f->rptr, len);
|
||||
if (func)
|
||||
func(dest, f->rptr, len);
|
||||
else {
|
||||
memcpy(dest, f->rptr, len);
|
||||
dest = (uint8_t *)dest + len;
|
||||
|
Reference in New Issue
Block a user