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");
DsError.ThrowExceptionForHR(hr);
IPin AudioInput = DsFindPin.ByDirection((IBaseFilter)AudioDecoder, PinDirection.Input, 0);
//No errors and AudioInput created OK
hr = m_FilterGraph.AddFilter((IBaseFilter)Demux, "MP4 Splitter");
DsError.ThrowExceptionForHR(hr);
//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!!