Re: Memory Leak in DirectShow
From: Vanathi (Vanathi_at_discussions.microsoft.com)
Date: 08/12/04
- Next message: The March Hare (MVP): "Re: CComPtr and CComQIPtr"
- Previous message: Nageshwar Rao: "How to cut the videos with no time gap between them?"
- In reply to: Richard Albury: "Re: Memory Leak in DirectShow"
- Next in thread: The March Hare (MVP): "Re: Memory Leak in DirectShow"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: The March Hare (MVP): "Re: CComPtr and CComQIPtr"
- Previous message: Nageshwar Rao: "How to cut the videos with no time gap between them?"
- In reply to: Richard Albury: "Re: Memory Leak in DirectShow"
- Next in thread: The March Hare (MVP): "Re: Memory Leak in DirectShow"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|