From eac2495095dc2e61f8b7539e2f9e3f5de1f01120 Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Sun, 10 Feb 2008 18:04:32 +0000 Subject: 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 --- libavfilter/formats.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavfilter/formats.c') diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 021e18abe7..3748030c0e 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; + } +} + -- cgit v1.2.3