Re: Memory Leak in DirectShow

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Vanathi (Vanathi_at_discussions.microsoft.com)
Date: 08/12/04


Date: Wed, 11 Aug 2004 23:33:01 -0700

We have to use DirectSHow coz down the line we also hv to play video files
The logic of the code is as follows
Play the wav file when there is an event. Continue to play till the event is
acknowledged.
We have two threads.
Thread 1 creates thread 2 ,does the initialisation of pointers, Renders the
file and calls the run method
Thread 2 Waits for the acknowledgedment of event and stops playing the .wav
file, calls the stop method and releases all the pointers.

So when an event occurs memory is allocated and the .wav file is played.
When the event is acked the file is stopped playing. But however the memory
not released, the Virtual memory also shows increased valued, the thread
count has increased, the handle count has increased...when we stop playing
the thread..

"Richard Albury" <"ralbury at jpg dot com" wrote:

> Vanathi wrote:
> > I am using directshow to play a .wav file when an event occurs. The .wav has
> > to be played until the event is acknowledged.
> >
> > So going by general logic, once the event is acknowledged, the memory used
> > to play the wav should also be released. But this is not happening in my
> > program.
> >
> > Moreover I am not building any COM component, I am using RenderFile and Run
> > method to play the .wav.
> >
> > I have run through the code a good many times, all pointers that are
> > initialized are released using SAFE_RELEASE macro.
>
> Presumably you're using DirectShow for more than looping a sound,
> because if not, you can use PlaySound(SND_ASYNC | SND_LOOP), right?
>
> I assume you're using IMediaControl, right?
>
> Are you calling Stop()?
>
> -- Richard
>



Relevant Pages

  • Re: Memory Leak in DirectShow
    ... Vanathi wrote: ... > So going by general logic, once the event is acknowledged, the memory used ... > to play the wav should also be released. ...
    (microsoft.public.win32.programmer.directx.video)
  • RE: Memory Leak in DirectShow
    ... everything but memory keeps on increasing, even tried CComPtr. ... > to play the wav should also be released. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Memory Leak in DirectShow
    ... > So going by general logic, once the event is acknowledged, the memory used ... > to play the wav should also be released. ... Common courtesy is to followup if someone helped you or if you found a solution on your own. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: On the relationship between teaching and virtuosity
    ... working the tempo to 100 bpm, after working up the little segments to tempo. ... I always play with a metronome until I am satisfied that the phrase is ... I really exerted myself and managed to memorize VL ... There is a delay while I bring up the memory. ...
    (rec.music.classical.guitar)
  • Re: Jaw-Dropping Pianism
    ... play) at a Baldwin Piano store in Palo Alto c. 1977; ... Apparently he was one of those people who have an eidetic memory, ... placement on the keyboard etc. ... I believe you can still get recordings from Artist Direct but I'm ...
    (rec.music.classical.recordings)