Re: IFilterGraph::RemoveFilter
From: Eric (saruman_at_telenet.be)
Date: 03/07/05
- Previous message: The March Hare [MVP]: "Re: text on video / user defined closed captioning?"
- In reply to: Eric: "Re: IFilterGraph::RemoveFilter"
- Next in thread: Peter Feldbaumer: "Re: IFilterGraph::RemoveFilter"
- Reply: Peter Feldbaumer: "Re: IFilterGraph::RemoveFilter"
- Reply: Eric: "Re: IFilterGraph::RemoveFilter"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Mar 2005 18:03:14 +0100
"Eric" <saruman@telenet.be> wrote in message
news:ev9ljKWIFHA.576@TK2MSFTNGP15.phx.gbl...
>
> "Alessandro Angeli [MVP::DigitalMedia]" <nobody@nowhere.in.the.net> wrote
> in message news:O5ywlxCIFHA.1476@TK2MSFTNGP09.phx.gbl...
>> Eric wrote:
>>
>>> Hello,
>>>
>>> When I call the IFilterGraph::RemoveFilter() method, my
>>> application crashes (access violation at 0x00000004).
>>> I use the code exactly like it is given in the directx
>>> doc. with topic 'Remove All the Filters in the Graph'.
>>> (The graph is in the 'Stopped' state).
>>
>> Since the invalid address is so low, it looks like you are
>> not passing in a pointer but a dereferenced value. Can you
>> post your code?
>>
>>
>> --
>>
>> // Alessandro Angeli
>> // MVP :: Digital Media
>> // a dot angeli at psynet dot net
>>
>>
>
>
> This is the code exactly copied from MSDN (it's the same as in my code):
>
> // Stop the graph.
> pControl->Stop();
>
> // Enumerate the filters in the graph.
> IEnumFilters *pEnum = NULL;
> HRESULT hr = pGraph->EnumFilters(&pEnum);
> if (SUCCEEDED(hr))
> {
> IBaseFilter *pFilter = NULL;
> while (S_OK == pEnum->Next(1, &pFilter, NULL))
> {
> // Remove the filter.
> pGraph->RemoveFilter(pFilter);
> // Reset the enumerator.
> pEnum->Reset();
> pFilter->Release();
> }
> pEnum->Release();
> }
>
>
> The program crashes when pEnum->Reset() is called.
>
I solved this problem by calling GetMediaType() followed by SetMediaType()
on the audio output pin of my capture device.
Now, everything works.
Now this is solved, I'm trying to use the TV Tuner and TV audio filter, but
this gives me the same crash like previous.
Seems that I have to set some video settings first (like I have to set on
the audio output pin).
- Previous message: The March Hare [MVP]: "Re: text on video / user defined closed captioning?"
- In reply to: Eric: "Re: IFilterGraph::RemoveFilter"
- Next in thread: Peter Feldbaumer: "Re: IFilterGraph::RemoveFilter"
- Reply: Peter Feldbaumer: "Re: IFilterGraph::RemoveFilter"
- Reply: Eric: "Re: IFilterGraph::RemoveFilter"
- Messages sorted by: [ date ] [ thread ]