[MPlayer-cvslog] r25407 - in trunk: libmenu/menu_dvbin.c stream/dvbin.h stream/stream_dvb.c
Ulion
ulion2002 at gmail.com
Sat Dec 15 14:40:06 CET 2007
2007/12/15, nicodvb <subversion at mplayerhq.hu>:
> Author: nicodvb
> Date: Sat Dec 15 14:30:44 2007
> New Revision: 25407
>
> Log:
> get rid of the file-static dvb_config and free the config at close() . Patch by Andrew Calkin and me
>
> Modified:
> trunk/libmenu/menu_dvbin.c
> trunk/stream/dvbin.h
> trunk/stream/stream_dvb.c
>
> Modified: trunk/libmenu/menu_dvbin.c
> ==============================================================================
> --- trunk/libmenu/menu_dvbin.c (original)
> +++ trunk/libmenu/menu_dvbin.c Sat Dec 15 14:30:44 2007
> @@ -248,6 +248,7 @@ static void read_cmd(menu_t* menu, int c
>
> static void close_menu(menu_t* menu)
> {
> + dvb_free_config(mpriv->config);
> menu_list_uninit(menu, free_entry);
> }
>
>
> Modified: trunk/stream/dvbin.h
> ==============================================================================
> --- trunk/stream/dvbin.h (original)
> +++ trunk/stream/dvbin.h Sat Dec 15 14:30:44 2007
> @@ -112,5 +112,6 @@ typedef struct {
> extern int dvb_step_channel(stream_t *, int);
> extern int dvb_set_channel(stream_t *, int, int);
> extern dvb_config_t *dvb_get_config(void);
> +extern void dvb_free_config(dvb_config_t *config);
>
> #endif
>
> Modified: trunk/stream/stream_dvb.c
> ==============================================================================
> --- trunk/stream/stream_dvb.c (original)
> +++ trunk/stream/stream_dvb.c Sat Dec 15 14:30:44 2007
> @@ -125,7 +125,6 @@ extern int dvb_tune(dvb_priv_t *priv, in
> fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout);
> extern char *dvb_dvrdev[4], *dvb_demuxdev[4], *dvb_frontenddev[4];
>
> -static dvb_config_t *dvb_config = NULL;
>
>
> static dvb_channels_list *dvb_get_channels(char *filename, int type)
> @@ -425,7 +424,26 @@ static dvb_channels_list *dvb_get_channe
> return list;
> }
>
> +void dvb_free_config(dvb_config_t *config)
> +{
> + int i;
>
> + for(i=0; i<config->count; i++)
> + {
> + if(config->cards[i].name)
> + free(config->cards[i].name);
> + if(!config->cards[i].list)
> + continue;
> + if(config->cards[i].list->channels)
> + {
> + if(config->cards[i].list->channels->name)
> + free(config->cards[i].list->channels->name);
> + free(config->cards[i].list->channels);
> + }
Here should loop for every channel in the channel list.
--
Ulion
More information about the MPlayer-cvslog
mailing list