[MPlayer-cvslog] r25057 - trunk/stream/tvi_dshow.c

voroshil subversion at mplayerhq.hu
Fri Nov 16 19:59:36 CET 2007


Author: voroshil
Date: Fri Nov 16 19:59:35 2007
New Revision: 25057

Log:
Make sure that mplayer will receive actual media type
instead of requested value.


Modified:
   trunk/stream/tvi_dshow.c

Modified: trunk/stream/tvi_dshow.c
==============================================================================
--- trunk/stream/tvi_dshow.c	(original)
+++ trunk/stream/tvi_dshow.c	Fri Nov 16 19:59:35 2007
@@ -1307,6 +1307,8 @@ static HRESULT build_sub_graph(priv_t * 
 {
     HRESULT hr;
 
+    AM_MEDIA_TYPE conn_mt; //Media type of established connection
+
     IPin *pSGIn;
     IPin *pSGOut;
     IPin *pNRIn=NULL;
@@ -1396,6 +1398,12 @@ static HRESULT build_sub_graph(priv_t * 
             mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: Unable to create pCapturePin<->pSGIn connection. Error:0x%x\n", (unsigned int)hr);
             break;
         }
+        hr = OLE_CALL_ARGS(pCapturePin, ConnectionMediaType, &conn_mt);
+        if(FAILED(hr))
+        {
+            mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TVI_DS_GetActualMediatypeFailed, (unsigned int)hr);
+            CopyMediaType(&conn_mt, pmt);
+        }
 
         if(priv->tv_param->hidden_video_renderer){
             IEnumFilters* pEnum;
@@ -1449,6 +1457,11 @@ static HRESULT build_sub_graph(priv_t * 
 
         hr = S_OK;
     } while(0);
+
+    FreeMediaType(pmt);
+    CopyMediaType(pmt, &conn_mt);
+    FreeMediaType(&conn_mt);
+
     OLE_RELEASE_SAFE(pSGF);
     OLE_RELEASE_SAFE(pSGIn);
     OLE_RELEASE_SAFE(pSGOut);



More information about the MPlayer-cvslog mailing list