mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 22:02:59 +00:00
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:
parent
1913d92f25
commit
a64cd8d3c8
11
stream/tv.c
11
stream/tv.c
@ -80,6 +80,17 @@ static const tvi_info_t* tvi_driver_list[]={
|
||||
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)
|
||||
{
|
||||
mp_msg(MSGT_TV,MSGL_INFO,"start scan\n");
|
||||
|
@ -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_free_handle(tvi_handle_t *h);
|
||||
|
||||
#define TV_NORM_PAL 1
|
||||
#define TV_NORM_NTSC 2
|
||||
#define TV_NORM_SECAM 3
|
||||
|
@ -68,17 +68,6 @@ static tvi_handle_t *new_handle(void)
|
||||
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.
|
||||
Other formats will be filled with 0xC0
|
||||
|
@ -3077,12 +3077,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
|
||||
priv->dev_index = a;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
if (priv->dev_index < 0) {
|
||||
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong device index: %d\n", a);
|
||||
free_handle(h);
|
||||
tv_free_handle(h);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -3091,12 +3091,12 @@ static tvi_handle_t *tvi_init_dshow(tv_param_t* tv_param)
|
||||
priv->adev_index = a;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
if (priv->dev_index < 0) {
|
||||
mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Wrong adevice index: %d\n", a);
|
||||
free_handle(h);
|
||||
tv_free_handle(h);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ static tvi_handle_t *tvi_init_v4l(tv_param_t* tv_param)
|
||||
|
||||
/* allocation failed */
|
||||
if (!priv->video_device) {
|
||||
free_handle(h);
|
||||
tv_free_handle(h);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
if (!PRIV->video_dev) {
|
||||
free_handle(tvi_handle);
|
||||
tv_free_handle(tvi_handle);
|
||||
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);
|
||||
if (!PRIV->audio_dev) {
|
||||
free(PRIV->video_dev);
|
||||
free_handle(tvi_handle);
|
||||
tv_free_handle(tvi_handle);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user