Cannot connect Audio filter when manually building graph

I have a problem in connecting the audio output from a Gabest MP4 Splitter to the input
of the ffdshow Audio decoder when playing an MP4 video. I usually let the graph builder render
itself but this time I need to connect these outputs myself as I want to ensure the exact
build of the graph.
The MP4 Splitter get created OK. If I ask to get an Ipin for the input it can do that. I just dont
seem to be able to get the IPin for the Audio output of the splitter.
When using GraphEdit all filters are present on the graph and fully connected for video but the
link from the Audio output to the Audiodecoder input is missing, hence no sound.

What are the steps required to get the connection?

Here is an extract of my code ( all the GUID stuff has already been done)

//Add the audio decoder
hr = m_FilterGraph.AddFilter((IBaseFilter)AudioDecoder, "ffdshow Audio Decoder");
IPin AudioInput = DsFindPin.ByDirection((IBaseFilter)AudioDecoder, PinDirection.Input, 0);

//No errors and AudioInput created OK

hr = m_FilterGraph.AddFilter((IBaseFilter)Demux, "MP4 Splitter");

//Splitter added OK

IPin MuxOutput = DsFindPin.ByDirection((IBaseFilter)Demux,PinDirection.Output, 0);

//MuxOutput always returns null ( I have tried other number combinations for the last parameter)

hr = m_FilterGraph.Connect(MuxOutput, AudioInput );

// Fails due to MuxOutput being null

I have been scouring the web for any possible solution but so far I have no answer. With your help the pain should go away!!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!