Need to be careful when dealing with references.
authorVitor Sessak <vitor1001@gmail.com>
Sun, 10 Feb 2008 18:04:32 +0000 (18:04 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Sun, 10 Feb 2008 18:04:32 +0000 (18:04 +0000)
Commited in SoC by Bobby Bingham

Originally committed as revision 11894 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/formats.c

index 021e18a..3748030 100644 (file)
@@ -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;
+    }
+}
+