From 7cdc5ad4fe61b7fd8cc6648256ab952409fd6846 Mon Sep 17 00:00:00 2001 From: voroshil Date: Sun, 29 Jul 2007 10:18:38 +0000 Subject: Removing global variables from tv:// Step 2: fixing tv subdrivers initialization. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23903 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tv.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'stream/tv.c') diff --git a/stream/tv.c b/stream/tv.c index 7258d7ff19..9605921151 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -505,11 +505,11 @@ done: return 1; } -static tvi_handle_t *tv_begin(void) +static tvi_handle_t *tv_begin(tv_param_t* tv_param) { int i; tvi_handle_t* h; - if(!strcmp(tv_param_driver,"help")){ + if(!strcmp(tv_param->driver,"help")){ mp_msg(MSGT_TV,MSGL_INFO,MSGTR_TV_AvailableDrivers); for(i=0;tvi_driver_list[i];i++){ mp_msg(MSGT_TV,MSGL_INFO," %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name); @@ -521,10 +521,11 @@ static tvi_handle_t *tv_begin(void) } for(i=0;tvi_driver_list[i];i++){ - if (!strcmp(tvi_driver_list[i]->short_name, tv_param_driver)){ - h=tvi_driver_list[i]->tvi_init(tv_param_device,tv_param_adevice); + if (!strcmp(tvi_driver_list[i]->short_name, tv_param->driver)){ + h=tvi_driver_list[i]->tvi_init(tv_param); if(!h) return NULL; + h->tv_param=tv_param; mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_DriverInfo, tvi_driver_list[i]->short_name, tvi_driver_list[i]->name, tvi_driver_list[i]->author, @@ -533,7 +534,7 @@ static tvi_handle_t *tv_begin(void) } } - mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoSuchDriver, tv_param_driver); + mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoSuchDriver, tv_param->driver); return(NULL); } @@ -555,7 +556,7 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer) tvi_functions_t *funcs; demuxer->priv=NULL; - if(!(tvh=tv_begin())) return NULL; + if(!(tvh=tv_begin(demuxer->stream->priv))) return NULL; if (!tvh->functions->init(tvh->priv)) return NULL; if (!open_tv(tvh)){ tv_uninit(tvh); -- cgit v1.2.3