dshow: release filter reference obtained from enumeration

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/2/head
Ramiro Polla 13 years ago committed by Michael Niedermayer
parent 5b186148bf
commit 21a928d07c
  1. 4
      libavdevice/dshow.c

@ -121,10 +121,12 @@ dshow_read_close(AVFormatContext *s)
if (r == S_OK) {
IBaseFilter *f;
IEnumFilters_Reset(fenum);
while (IEnumFilters_Next(fenum, 1, &f, NULL) == S_OK)
while (IEnumFilters_Next(fenum, 1, &f, NULL) == S_OK) {
if (IGraphBuilder_RemoveFilter(ctx->graph, f) == S_OK)
IEnumFilters_Reset(fenum); /* When a filter is removed,
* the list must be reset. */
IBaseFilter_Release(f);
}
IEnumFilters_Release(fenum);
}
IGraphBuilder_Release(ctx->graph);

Loading…
Cancel
Save