summaryrefslogtreecommitdiff
path: root/libavfilter/formats.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-10 18:05:02 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-10 18:05:02 +0000
commit9189411bdb3e7137ee9aeed38ce56715b487836c (patch)
treee4417c2364977ba0077e8f724c8c1e4b62c65521 /libavfilter/formats.c
parent93faa9fad75e3038b3ebf5664f524824230a401a (diff)
Coding style changes
Originally committed as revision 11901 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/formats.c')
-rw-r--r--libavfilter/formats.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index b3873d7acb..cc7924326f 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -51,8 +51,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
if(a->formats[i] == b->formats[j])
ret->formats[k++] = a->formats[i];
+ ret->format_count = k;
/* check that there was at least one common format */
- if(!(ret->format_count = k)) {
+ if(!ret->format_count) {
av_free(ret->formats);
av_free(ret);
return NULL;
@@ -117,9 +118,9 @@ static int find_ref_index(AVFilterFormats **ref)
void avfilter_formats_unref(AVFilterFormats **ref)
{
- int idx;
+ int idx = find_ref_index(ref);
- if((idx = find_ref_index(ref)) >= 0)
+ if(idx >= 0)
memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
@@ -134,9 +135,9 @@ void avfilter_formats_unref(AVFilterFormats **ref)
void avfilter_formats_changeref(AVFilterFormats **oldref,
AVFilterFormats **newref)
{
- int idx;
+ int idx = find_ref_index(oldref);
- if((idx = find_ref_index(oldref)) >= 0) {
+ if(idx >= 0) {
(*oldref)->refs[idx] = newref;
*newref = *oldref;
*oldref = NULL;