Some fixes for filtergraph.c (#2)

Christian Costa titan.costa at wanadoo.fr
Sun Apr 24 14:17:39 CDT 2005


>
>
>>>
>> This is not correct, you must connect all pins, not just the first 
>> that succeeds.
>
>
> Asleep? ;) You can't connect an input pin more then once 
> (VFW_E_ALREADY_CONNECTED), anyway this function always returned S_OK, 
> I fixed that too now... If you still think multiple connects should 
> happen 
> http://msdn.microsoft.com/library/en-us/directshow/htm/ipinconnect.asp ;) 


No, no. It's not necessary. I'm convinced. :-)

> 
> static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
>     ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
>+    TRACE("(%p/%p)->()\n", This, iface);
> 
>-    TRACE("(%p/%p)->(): stub !!!\n", This, iface);
>+    if (This->state == State_Paused) return S_OK;
>+
>+    SendTheFilterAMessage(iface, SendPause);
>+    This->state = State_Paused;
> 
>     return S_OK;
> }
>  
>
Shouldn't S_FALSE be returned in the last statement?

> 
> static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
>     ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
>+    TRACE("(%p/%p)->()\n", This, iface);
> 
>-    TRACE("(%p/%p)->(): stub !!!\n", This, iface);
>+    if (This->state == State_Stopped) return S_OK;
>+    if (This->state == State_Running) SendTheFilterAMessage(iface, SendPause);
>+    SendTheFilterAMessage(iface, SendStop);
>+    This->state = State_Stopped;
> 
>     return S_OK;
> }
>  
>
I think you should move the critical section out of 
SendTheFilterAMessage and put it in Run, Pause and Stop methods.

Bye,
Christian

PS: SendTheFilterAMessage and FoundFilter are really odd names, no?






More information about the wine-devel mailing list