From dd41036a4c39252115b2f22b50d4681fb872369a Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Fri, 9 Sep 2011 00:16:06 -0300 Subject: [PATCH] dshow: cleanup internal references on capture interface Signed-off-by: Stefano Sabatini --- libavdevice/dshow_enumpins.c | 8 +++++++- libavdevice/dshow_filter.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libavdevice/dshow_enumpins.c b/libavdevice/dshow_enumpins.c index 97890fb88e..02e967ae63 100644 --- a/libavdevice/dshow_enumpins.c +++ b/libavdevice/dshow_enumpins.c @@ -94,6 +94,12 @@ libAVEnumPins_Setup(libAVEnumPins *this, libAVPin *pin, libAVFilter *filter) return 1; } +static int +libAVEnumPins_Cleanup(libAVEnumPins *this) +{ + libAVFilter_Release(this->filter); + return 1; +} DECLARE_CREATE(libAVEnumPins, libAVEnumPins_Setup(this, pin, filter), libAVPin *pin, libAVFilter *filter) -DECLARE_DESTROY(libAVEnumPins, nothing) +DECLARE_DESTROY(libAVEnumPins, libAVEnumPins_Cleanup) diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c index e5a3be854b..64e8306536 100644 --- a/libavdevice/dshow_filter.c +++ b/libavdevice/dshow_filter.c @@ -191,6 +191,12 @@ libAVFilter_Setup(libAVFilter *this, void *priv_data, void *callback, return 1; } +static int +libAVFilter_Cleanup(libAVFilter *this) +{ + libAVPin_Release(this->pin); + return 1; +} DECLARE_CREATE(libAVFilter, libAVFilter_Setup(this, priv_data, callback, type), void *priv_data, void *callback, enum dshowDeviceType type) -DECLARE_DESTROY(libAVFilter, nothing) +DECLARE_DESTROY(libAVFilter, libAVFilter_Cleanup)