Click here to Skip to main content
12,692,105 members (32,531 online)

DirectShow leak after continuous creation/destruction of graph

mOOmOOn_ asked:

Open original thread

Bascially, I get a crash in a DirectShow application after hundreds of start/stop sequences.

I developed a simple application aiming to reproduce the problem and I get some strange behaviour at some point.

I may include the application code in a further post if necessary, but it based on

- OpenStartClip : Creates all the VMR9 stuff, including RenderFile and Run.
- StopCloseClip : Stops the graph and releases all interfaces
- The GraphEvent Handler : When receiving EC_COMPLETE or EC_USERABORT, posts a private WM_RESTART message to the application

Hence, the test application is supposed to play a file continuously by starting it again when finished.

The clip is a 6" WMV clip.

This works whell for about 1200 playback sessions, but at some point, it does not work anymore : playback is never started again.
Moreover, the last try session shows I got an unforeseen message in the GraphEvent Handler which code is 0x201 and is not documented (unless it is the WM_LBUTTONDOWN message which is not supposed to be triggered by DirectShow in the Callback).
Note that this message is triggered during the OpenClip treatment, as in that case I do not get the usuall EC_PAUSED I got when the application runs fine when starting playback.

Notice that I can exit the application propely, but I cannot start any new playback again while launching the application : I need to reboot the computer to get it work again.

This test was done with XP but I suppose it it the same with Seven as my general application stops on both OS after a while.

So the first clues are for me to know
- if some leaks are known in the DirectShow implementation process
- why I encounter this 0x201 error after hundreds of start/stop

I may provide the test code if necessary, but will avoid it in this first post in order not to pollute.

Thanks in advance.
Tags: C++, directshow


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100