From 8e2f39307a8d5155bef1f7ee0fd4e02aea66004f Mon Sep 17 00:00:00 2001 From: voroshil Date: Mon, 19 Nov 2007 19:15:36 +0000 Subject: Code unification: get rid of local variable arpmtVBI and use chain structure's arpmt member. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25109 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_dshow.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'stream') diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index acac44eaa4..a85ecde048 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -2518,7 +2518,6 @@ static HRESULT build_vbi_chain(priv_t *priv) { #ifdef HAVE_TV_TELETEXT HRESULT hr; - AM_MEDIA_TYPE* arpmtVBI[2] = { priv->chains[2]->pmt, NULL }; if(priv->chains[2]->rbuf) return S_OK; @@ -2531,9 +2530,7 @@ static HRESULT build_vbi_chain(priv_t *priv) init_ringbuffer(priv->chains[2]->rbuf,24,priv->tsp.bufsize); - priv->chains[2]->pmt=calloc(1,sizeof(AM_MEDIA_TYPE)); - priv->chains[2]->pmt->majortype=MEDIATYPE_VBI; - hr=build_sub_graph(priv, priv->chains[0]->pCaptureFilter, priv->chains[2]->rbuf,arpmtVBI,NULL,&PIN_CATEGORY_VBI); + hr=build_sub_graph(priv, priv->chains[0]->pCaptureFilter, priv->chains[2]->rbuf,priv->chains[2]->arpmt,NULL,&PIN_CATEGORY_VBI); if(FAILED(hr)){ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TVI_DS_UnableBuildVBISubGraph,(unsigned int)hr); return 0; @@ -2798,6 +2795,16 @@ static int init(priv_t * priv) priv->chains[1]->pStreamConfig = NULL; } } + /* + Getting formats for VBI stream + */ + priv->chains[2]->nFormatUsed = 0; + priv->chains[2]->arpmt = calloc(2, sizeof(AM_MEDIA_TYPE*)); + priv->chains[2]->arpmt[0] = calloc(1, sizeof(AM_MEDIA_TYPE)); + priv->chains[2]->arpmt[0]->majortype = MEDIATYPE_VBI; + + priv->chains[2]->pmt = CreateMediaType(priv->chains[2]->arpmt[priv->chains[2]->nFormatUsed]); + /* debug */ { int i; -- cgit v1.2.3