diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-02 16:26:55 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-02 18:24:49 +0200 |
commit | 77b32b73ed31f9aaa6c1e476c9a041399a35be9d (patch) | |
tree | f422b0d0db1fe00a3e340f8bcf4ea9965023bcc8 /libavfilter | |
parent | d013c6da80003cb4b577867d1f091e47a0fe3776 (diff) | |
download | ffmpeg-77b32b73ed31f9aaa6c1e476c9a041399a35be9d.tar.gz |
lavfi: apply misc style fixes
Adopt K&R style for overall consistency/readability.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/avfilter.c | 14 | ||||
-rw-r--r-- | libavfilter/defaults.c | 22 | ||||
-rw-r--r-- | libavfilter/internal.h | 2 |
3 files changed, 19 insertions, 19 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 72e0a87f8e..b7ad6f0503 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -77,8 +77,8 @@ static void store_in_pool(AVFilterBufferRef *ref) av_assert0(ref->buf->data[0]); - if(pool->count == POOL_SIZE){ - AVFilterBufferRef *ref1= pool->pic[0]; + if (pool->count == POOL_SIZE) { + AVFilterBufferRef *ref1 = pool->pic[0]; av_freep(&ref1->video); av_freep(&ref1->audio); av_freep(&ref1->buf->data[0]); @@ -89,9 +89,9 @@ static void store_in_pool(AVFilterBufferRef *ref) pool->pic[POOL_SIZE-1] = NULL; } - for(i=0; i<POOL_SIZE; i++){ - if(!pool->pic[i]){ - pool->pic[i]= ref; + for (i = 0; i < POOL_SIZE; i++) { + if (!pool->pic[i]) { + pool->pic[i] = ref; pool->count++; break; } @@ -102,8 +102,8 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref) { if (!ref) return; - if (!(--ref->buf->refcount)){ - if(!ref->buf->free){ + if (!(--ref->buf->refcount)) { + if (!ref->buf->free) { store_in_pool(ref); return; } diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c index 9ee23e57b7..74ba599f9c 100644 --- a/libavfilter/defaults.c +++ b/libavfilter/defaults.c @@ -40,28 +40,28 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per uint8_t *data[4]; int i; AVFilterBufferRef *picref = NULL; - AVFilterPool *pool= link->pool; + AVFilterPool *pool = link->pool; - if(pool) for(i=0; i<POOL_SIZE; i++){ - picref= pool->pic[i]; - if(picref && picref->buf->format == link->format && picref->buf->w == w && picref->buf->h == h){ - AVFilterBuffer *pic= picref->buf; - pool->pic[i]= NULL; + if (pool) for (i = 0; i < POOL_SIZE; i++) { + picref = pool->pic[i]; + if (picref && picref->buf->format == link->format && picref->buf->w == w && picref->buf->h == h) { + AVFilterBuffer *pic = picref->buf; + pool->pic[i] = NULL; pool->count--; picref->video->w = w; picref->video->h = h; picref->perms = perms | AV_PERM_READ; - picref->format= link->format; + picref->format = link->format; pic->refcount = 1; memcpy(picref->data, pic->data, sizeof(picref->data)); memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize)); return picref; } - }else + } else pool = link->pool = av_mallocz(sizeof(AVFilterPool)); // +2 is needed for swscaler, +16 to be SIMD-friendly - if ((i=av_image_alloc(data, linesize, w, h, link->format, 16)) < 0) + if ((i = av_image_alloc(data, linesize, w, h, link->format, 16)) < 0) return NULL; picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize, @@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per } memset(data[0], 128, i); - picref->buf->priv= pool; - picref->buf->free= NULL; + picref->buf->priv = pool; + picref->buf->free = NULL; return picref; } diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 333dcbff81..be1e9b08f2 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -31,7 +31,7 @@ typedef struct AVFilterPool { AVFilterBufferRef *pic[POOL_SIZE]; int count; -}AVFilterPool; +} AVFilterPool; /** * Check for the validity of graph. |