mirror of https://git.ffmpeg.org/ffmpeg.git
fifo: K&R formatting cosmetics
This commit is contained in:
parent
4e7f0b082d
commit
73142e7533
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue