[QUARTZ] More fixes

Christian Costa titan.costa at wanadoo.fr
Mon Jun 6 17:01:15 CDT 2005


Hi,

Changelog:
Don't use fullscreen mode in video renderer for now and improve error 
handling a bit.
Improved a bit Run/Pause/Stop methods of parser template.

Christian Costa   titan.costa at wanadoo.fr

-------------- next part --------------
Index: dlls/quartz/videorenderer.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/videorenderer.c,v
retrieving revision 1.10
diff -u -r1.10 videorenderer.c
--- dlls/quartz/videorenderer.c	6 Jun 2005 19:50:36 -0000	1.10
+++ dlls/quartz/videorenderer.c	6 Jun 2005 20:48:08 -0000
@@ -127,7 +127,7 @@
 	return hr;
     }
 
-    hr = IDirectDraw_SetCooperativeLevel(This->ddraw, NULL, DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE);
+    hr = IDirectDraw_SetCooperativeLevel(This->ddraw, GetDesktopWindow(), DDSCL_NORMAL);
     if (FAILED(hr)) {
 	ERR("Cannot set fulscreen mode\n");
 	return hr;
@@ -298,12 +298,13 @@
     
     if (!This->init)
     {
-	This->init = 1;
 	hr = VideoRenderer_CreatePrimarySurface(iface);
 	if (FAILED(hr))
 	{
 	    ERR("Unable to create primary surface\n");
+	    return hr;
 	}
+	This->init = 1;
     }
 
     VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
Index: dlls/quartz/avidec.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/avidec.c,v
retrieving revision 1.17
diff -u -r1.17 avidec.c
--- dlls/quartz/avidec.c	21 Feb 2005 20:37:45 -0000	1.17
+++ dlls/quartz/avidec.c	6 Jun 2005 20:48:10 -0000
@@ -218,7 +218,7 @@
             /* Update output media type */
             CopyMediaType(outpmt, pmt);
             outpmt->subtype = *outsubtype;
-            memcpy(&(((VIDEOINFOHEADER*)outpmt->pbFormat)->bmiHeader), This->pBihOut, This->pBihOut->biSize); 
+            memcpy(&(((VIDEOINFOHEADER*)outpmt->pbFormat)->bmiHeader), This->pBihOut, This->pBihOut->biSize);
 
             /* Update buffer size of media samples in output */
             ((OutputPin*)This->tf.ppPins[1])->allocProps.cbBuffer = This->pBihOut->biSizeImage;
Index: dlls/quartz/parser.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/parser.c,v
retrieving revision 1.16
diff -u -r1.16 parser.c
--- dlls/quartz/parser.c	6 Jun 2005 19:50:36 -0000	1.16
+++ dlls/quartz/parser.c	6 Jun 2005 20:48:12 -0000
@@ -221,6 +221,8 @@
 
     TRACE("()\n");
 
+    if (This->state == State_Stopped) return S_OK;
+
     EnterCriticalSection(&This->csFilter);
     {
         hr = PullPin_StopProcessing(This->pInputPin);
@@ -239,6 +241,8 @@
     
     TRACE("()\n");
 
+    if (This->state == State_Paused) return S_OK;
+
     EnterCriticalSection(&This->csFilter);
     {
         bInit = (This->state == State_Stopped);
@@ -250,7 +254,7 @@
     {
         unsigned int i;
 
-        /*hr = PullPin_Seek(This->pInputPin, This->CurrentChunkOffset, This->EndOfFile); */
+        hr = PullPin_Seek(This->pInputPin, 0, ((LONGLONG)0x7fffffff << 32) | 0xffffffff);
 
         if (SUCCEEDED(hr))
             hr = PullPin_InitProcessing(This->pInputPin);
@@ -275,6 +279,9 @@
     }
     /* FIXME: else pause thread */
 
+    if (SUCCEEDED(hr))
+        hr = PullPin_PauseProcessing(This->pInputPin);
+
     return hr;
 }
 
@@ -286,21 +293,32 @@
 
     TRACE("(%s)\n", wine_dbgstr_longlong(tStart));
 
+    if (This->state == State_Running) return S_OK;
+
     EnterCriticalSection(&This->csFilter);
     {
         This->rtStreamStart = tStart;
-        This->state = State_Running;
 
-        hr = PullPin_InitProcessing(This->pInputPin);
+        hr = PullPin_Seek(This->pInputPin, tStart, ((LONGLONG)0x7fffffff << 32) | 0xffffffff);
 
-        if (SUCCEEDED(hr))
-        { 
-            for (i = 1; i < This->cStreams + 1; i++)
-            {
-                OutputPin_CommitAllocator((OutputPin *)This->ppPins[i]);
+        if (SUCCEEDED(hr) && (This->state == State_Stopped))
+        {
+            hr = PullPin_InitProcessing(This->pInputPin);
+
+            if (SUCCEEDED(hr))
+            { 
+                for (i = 1; i < (This->cStreams + 1); i++)
+                {
+                    OutputPin_CommitAllocator((OutputPin *)This->ppPins[i]);
+                }
             }
-            hr = PullPin_StartProcessing(This->pInputPin);
         }
+
+        if (SUCCEEDED(hr))
+            hr = PullPin_StartProcessing(This->pInputPin);
+
+        if (SUCCEEDED(hr))
+            This->state = State_Running;
     }
     LeaveCriticalSection(&This->csFilter);
 


More information about the wine-patches mailing list