stream/tv: move free_handle() from header to tv.c

Move TV input free_handle static function to tv.c and make it non-static.
There is no need to duplicate the function in the binary.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32174 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2010-09-11 23:53:15 +00:00 committed by Uoti Urpala
parent 1913d92f25
commit a64cd8d3c8
6 changed files with 20 additions and 18 deletions

View File

@ -80,6 +80,17 @@ static const tvi_info_t* tvi_driver_list[]={
NULL NULL
}; };
void tv_free_handle(tvi_handle_t *h)
{
if (h) {
if (h->priv)
free(h->priv);
if (h->scan)
free(h->scan);
free(h);
}
}
void tv_start_scan(tvi_handle_t *tvh, int start) void tv_start_scan(tvi_handle_t *tvh, int start)
{ {
mp_msg(MSGT_TV,MSGL_INFO,"start scan\n"); mp_msg(MSGT_TV,MSGL_INFO,"start scan\n");

View File

@ -255,6 +255,8 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm);
void tv_start_scan(tvi_handle_t *tvh, int start); void tv_start_scan(tvi_handle_t *tvh, int start);
void tv_free_handle(tvi_handle_t *h);
#define TV_NORM_PAL 1 #define TV_NORM_PAL 1
#define TV_NORM_NTSC 2 #define TV_NORM_NTSC 2
#define TV_NORM_SECAM 3 #define TV_NORM_SECAM 3

View File

@ -68,17 +68,6 @@ static tvi_handle_t *new_handle(void)
return h; return h;
} }
static void free_handle(tvi_handle_t *h)
{
if (h) {
if (h->priv)
free(h->priv);
if (h->scan)
free(h->scan);
free(h);
}
}
/** /**
Fills video frame in given buffer with blue color for yv12,i420,uyvy,yuy2. Fills video frame in given buffer with blue color for yv12,i420,uyvy,yuy2.
Other formats will be filled with 0xC0 Other formats will be filled with 0xC0

View File

@ -3077,12 +3077,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
priv->dev_index = a; priv->dev_index = a;
} else { } else {
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device parameter: %s\n", tv_param->device); mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device parameter: %s\n", tv_param->device);
free_handle(h); tv_free_handle(h);
return NULL; return NULL;
} }
if (priv->dev_index < 0) { if (priv->dev_index < 0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device index: %d\n", a); mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device index: %d\n", a);
free_handle(h); tv_free_handle(h);
return NULL; return NULL;
} }
} }
@ -3091,12 +3091,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
priv->adev_index = a; priv->adev_index = a;
} else { } else {
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice parameter: %s\n", tv_param->adevice); mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice parameter: %s\n", tv_param->adevice);
free_handle(h); tv_free_handle(h);
return NULL; return NULL;
} }
if (priv->dev_index < 0) { if (priv->dev_index < 0) {
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice index: %d\n", a); mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice index: %d\n", a);
free_handle(h); tv_free_handle(h);
return NULL; return NULL;
} }
} }

View File

@ -330,7 +330,7 @@ static tvi_handle_t *tvi_init_v4l(tv_param_t* tv_param)
/* allocation failed */ /* allocation failed */
if (!priv->video_device) { if (!priv->video_device) {
free_handle(h); tv_free_handle(h);
return NULL; return NULL;
} }

View File

@ -1077,7 +1077,7 @@ static tvi_handle_t *tvi_init_v4l2(tv_param_t* tv_param)
PRIV->video_dev = strdup(tv_param->device? tv_param->device: "/dev/video0"); PRIV->video_dev = strdup(tv_param->device? tv_param->device: "/dev/video0");
if (!PRIV->video_dev) { if (!PRIV->video_dev) {
free_handle(tvi_handle); tv_free_handle(tvi_handle);
return NULL; return NULL;
} }
@ -1085,7 +1085,7 @@ static tvi_handle_t *tvi_init_v4l2(tv_param_t* tv_param)
PRIV->audio_dev = strdup(tv_param->adevice); PRIV->audio_dev = strdup(tv_param->adevice);
if (!PRIV->audio_dev) { if (!PRIV->audio_dev) {
free(PRIV->video_dev); free(PRIV->video_dev);
free_handle(tvi_handle); tv_free_handle(tvi_handle);
return NULL; return NULL;
} }
} }