diff options
author | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-18 10:55:51 +0000 |
---|---|---|
committer | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-18 10:55:51 +0000 |
commit | 1e663de8923f2a69b98f95bc4c922d13ab639eaa (patch) | |
tree | d96bd8e29a209bb83258e3381b4b40f27416cafc /stream | |
parent | 790cd7ec47ec36e43527338b1019c3c3aa5e3556 (diff) |
Move setting media format code
closer to connection establishment routine.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25092 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/tvi_dshow.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index d71c94b0a2..87d80455e3 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -1369,11 +1369,6 @@ static HRESULT build_sub_graph(priv_t * priv, IBaseFilter * pCaptureFilter, mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: QueryInterface(IID_ISampleGrabber) call failed. Error:0x%x\n", (unsigned int)hr); break; } - hr = OLE_CALL_ARGS(pSG, SetMediaType, arpmt[nFormatProbed]); //set desired mediatype - if(FAILED(hr)){ - mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: SetMediaType(pSG) call failed. Error:0x%x\n", (unsigned int)hr); - break; - } // hr = OLE_CALL_ARGS(pSG, SetCallback, (ISampleGrabberCB *) pCSGCB, 1); //we want to receive copy of sample's data hr = OLE_CALL_ARGS(pSG, SetCallback, (ISampleGrabberCB *) priv->pCSGCB, 0); //we want to receive sample @@ -1391,18 +1386,22 @@ static HRESULT build_sub_graph(priv_t * priv, IBaseFilter * pCaptureFilter, mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: SetBufferSamples(pSG) call failed. Error:0x%x\n", (unsigned int)hr); break; } - OLE_RELEASE_SAFE(pSG); - if(priv->tv_param->normalize_audio_chunks && !memcmp(&(arpmt[nFormatProbed]->majortype),&(MEDIATYPE_Audio),16)){ set_buffer_preference(20,(WAVEFORMATEX*)(arpmt[nFormatProbed]->pbFormat),pCapturePin,pSGIn); } + hr = OLE_CALL_ARGS(pSG, SetMediaType, arpmt[nFormatProbed]); //set desired mediatype + if(FAILED(hr)){ + mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: SetMediaType(pSG) call failed. Error:0x%x\n", (unsigned int)hr); + break; + } /* connecting filters together: VideoCapture --> SampleGrabber */ hr = OLE_CALL_ARGS(priv->pGraph, Connect, pCapturePin, pSGIn); if(FAILED(hr)){ mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: Unable to create pCapturePin<->pSGIn connection. Error:0x%x\n", (unsigned int)hr); break; } + OLE_RELEASE_SAFE(pSG); hr = OLE_CALL_ARGS(pCapturePin, ConnectionMediaType, pmt); if(FAILED(hr)) |