I have created a custom source filter that plays WMV's over a network using an IStream object and IWMSyncReader. My problem is I used CSource and CSourceStream but I have yet to find a way to have two CSourceStreams FillBuffer methods cordinate calling the IWMSyncReader for a new sample without A) out of sync audio/video or B) video/audio skips.

I have the IWMSyncReader existing in the filter while the two Pins access the IWMSyncReader from the FillBuffer methods calling into a filter method.

So my question is there a way to create a worker thread inside of a CBaseFilter which would use the stream_num attribute from the IWMSyncReader to send the sample to the correct pin. Similar to the WMV parser filter on http://www.gdcl.co.uk/downloads.htm, which uses the IWMReader callback to deliver samples to the output pin.

If anyone could help with the CSourceStream method or CBaseFilter worker thread I would greatly appreciate it.

Thanks Tuppo

Re: DirectShow Development Custom Source Filter for WMV's

Chris P.

There's no callback method on the SyncReader, you would have to use the ASyncReader.

But it sounds like you should be able to make what you have work by having more buffers to prevent the blocking. Each pin's FillBuffer calls a function in your filter where it blocks waiting for a sample. Another thread in your filter reads a sample (after being told to via an event) and then signals the appropriate output thread to collect.

You could also use delivery queues, a little more complicated but more reliable.