# HG changeset patch # User voroshil # Date 1195239575 0 # Node ID c9f20e41bc130b3c90b726a0aa3b2169033ef7f6 # Parent 2cae9470f53b989aebaeafc3d7a1396fd4a9ee13 Make sure that mplayer will receive actual media type instead of requested value. diff -r 2cae9470f53b -r c9f20e41bc13 stream/tvi_dshow.c --- a/stream/tvi_dshow.c Fri Nov 16 17:57:12 2007 +0000 +++ b/stream/tvi_dshow.c Fri Nov 16 18:59:35 2007 +0000 @@ -1307,6 +1307,8 @@ { HRESULT hr; + AM_MEDIA_TYPE conn_mt; //Media type of established connection + IPin *pSGIn; IPin *pSGOut; IPin *pNRIn=NULL; @@ -1396,6 +1398,12 @@ 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 @@ 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);