Originally committed as revision 11901 to svn://svn.ffmpeg.org/ffmpeg/trunk
if(a->formats[i] == b->formats[j])
ret->formats[k++] = a->formats[i];
if(a->formats[i] == b->formats[j])
ret->formats[k++] = a->formats[i];
/* check that there was at least one common format */
/* 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;
av_free(ret->formats);
av_free(ret);
return NULL;
void avfilter_formats_unref(AVFilterFormats **ref)
{
void avfilter_formats_unref(AVFilterFormats **ref)
{
+ int idx = find_ref_index(ref);
- if((idx = find_ref_index(ref)) >= 0)
memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
void avfilter_formats_changeref(AVFilterFormats **oldref,
AVFilterFormats **newref)
{
void avfilter_formats_changeref(AVFilterFormats **oldref,
AVFilterFormats **newref)
{
+ int idx = find_ref_index(oldref);
- if((idx = find_ref_index(oldref)) >= 0) {
(*oldref)->refs[idx] = newref;
*newref = *oldref;
*oldref = NULL;
(*oldref)->refs[idx] = newref;
*newref = *oldref;
*oldref = NULL;