diff options
-rw-r--r-- | libavfilter/formats.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; + } +} + |