summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-11 23:53:15 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:16:46 +0200
commita64cd8d3c802f91ae77d1cf20ee9300bea079cd6 (patch)
tree05e1893dfc41c6fd4ad74523a932acd9975bce50
parent1913d92f25847a04170e0fec9dde37059cd4c95d (diff)
downloadmpv-a64cd8d3c802f91ae77d1cf20ee9300bea079cd6.tar.bz2
mpv-a64cd8d3c802f91ae77d1cf20ee9300bea079cd6.tar.xz
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
-rw-r--r--stream/tv.c11
-rw-r--r--stream/tv.h2
-rw-r--r--stream/tvi_def.h11
-rw-r--r--stream/tvi_dshow.c8
-rw-r--r--stream/tvi_v4l.c2
-rw-r--r--stream/tvi_v4l2.c4
6 files changed, 20 insertions, 18 deletions
diff --git a/stream/tv.c b/stream/tv.c
index cb1fe59fee..55b7033adb 100644
--- a/stream/tv.c
+++ b/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");
diff --git a/stream/tv.h b/stream/tv.h
index c2e8e05120..ed5fd135d7 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -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
diff --git a/stream/tvi_def.h b/stream/tvi_def.h
index 43de8c6423..01c2222621 100644
--- a/stream/tvi_def.h
+++ b/stream/tvi_def.h
@@ -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
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 0b60fff255..1aedc10642 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -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;
}
}
diff --git a/stream/tvi_v4l.c b/stream/tvi_v4l.c
index 4f73c03bec..cc16e92e22 100644
--- a/stream/tvi_v4l.c
+++ b/stream/tvi_v4l.c
@@ -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;
}
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 91f574f901..4bdf4c499d 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -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;
}
}