From: Vitor Sessak Date: Sun, 10 Feb 2008 18:04:32 +0000 (+0000) Subject: Need to be careful when dealing with references. X-Git-Tag: v0.5~6071 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eac2495095dc2e61f8b7539e2f9e3f5de1f01120;p=platform%2Fupstream%2Flibav.git Need to be careful when dealing with references. Commited in SoC by Bobby Bingham Originally committed as revision 11894 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 021e18a..3748030 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -134,3 +134,15 @@ void avfilter_formats_unref(AVFilterFormats **ref) *ref = NULL; } +void avfilter_formats_changeref(AVFilterFormats **oldref, + AVFilterFormats **newref) +{ + int idx; + + if((idx = find_ref_index(oldref)) >= 0) { + (*oldref)->refs[idx] = newref; + *newref = *oldref; + *oldref = NULL; + } +} +