# HG changeset patch # User voroshil # Date 1195499736 0 # Node ID ceaf17d2796637cc545fd2435d6b2d9e7141561a # Parent bfebab93b11ebdbba4eb8cc656443fa03370a5f2 Code unification: get rid of local variable arpmtVBI and use chain structure's arpmt member. diff -r bfebab93b11e -r ceaf17d27966 stream/tvi_dshow.c --- a/stream/tvi_dshow.c Mon Nov 19 19:02:09 2007 +0000 +++ b/stream/tvi_dshow.c Mon Nov 19 19:15:36 2007 +0000 @@ -2518,7 +2518,6 @@ { #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 @@ 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 @@ 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;