dshow: reset list for each filter removed

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
This commit is contained in:
Ramiro Polla 2011-09-13 14:55:08 -03:00 committed by Stefano Sabatini
parent 215e197942
commit a1644f6287
1 changed files with 3 additions and 1 deletions

View File

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