From 92af740b7286a6fb96c767aa9fb3cf06164b8b83 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 11 Nov 2001 03:53:42 +0000 Subject: [PATCH] cleaned up some warnings, and tv_param_on moved out from #ifdef USE_TV git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2820 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/tv.c | 3 ++- libmpdemux/tv.h | 3 ++- libmpdemux/tvi_def.h | 2 +- libmpdemux/tvi_v4l.c | 10 +++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c index 53ce31a6ee..db264f8ae3 100644 --- a/libmpdemux/tv.c +++ b/libmpdemux/tv.c @@ -12,6 +12,8 @@ #include "config.h" +int tv_param_on = 0; + #ifdef USE_TV #include "mp_msg.h" #include "help_mp.h" @@ -25,7 +27,6 @@ unsigned long tv_param_freq = 0; char *tv_param_channel = "0"; char *tv_param_norm = "pal"; -int tv_param_on = 0; char *tv_param_device = NULL; char *tv_param_driver = "dummy"; int tv_param_width = -1; diff --git a/libmpdemux/tv.h b/libmpdemux/tv.h index 275f56804b..a7a7a67160 100644 --- a/libmpdemux/tv.h +++ b/libmpdemux/tv.h @@ -1,5 +1,7 @@ #include "config.h" +extern int tv_param_on; + #ifdef USE_TV #include "../libao2/afmt.h" #include "../libvo/img_format.h" @@ -9,7 +11,6 @@ extern unsigned long tv_param_freq; extern char *tv_param_channel; extern char *tv_param_norm; -extern int tv_param_on; extern char *tv_param_device; extern char *tv_param_driver; extern int tv_param_width; diff --git a/libmpdemux/tvi_def.h b/libmpdemux/tvi_def.h index 87511951d7..30658f3304 100644 --- a/libmpdemux/tvi_def.h +++ b/libmpdemux/tvi_def.h @@ -21,7 +21,7 @@ static tvi_functions_t functions = static tvi_handle_t *new_handle() { - tvi_handle_t *h = malloc(sizeof(tvi_handle_t)); + tvi_handle_t *h = (tvi_handle_t *)malloc(sizeof(tvi_handle_t)); if (!h) return(NULL); diff --git a/libmpdemux/tvi_v4l.c b/libmpdemux/tvi_v4l.c index 2499abf7ee..0918f5076d 100644 --- a/libmpdemux/tvi_v4l.c +++ b/libmpdemux/tvi_v4l.c @@ -206,12 +206,12 @@ tvi_handle_t *tvi_init_v4l(char *device) /* set video device name */ if (!device) { - priv->video_device = malloc(strlen("/dev/video0")); + priv->video_device = (char *)malloc(strlen("/dev/video0")); sprintf(priv->video_device, "/dev/video0"); } else { - priv->video_device = malloc(strlen(device)); + priv->video_device = (char *)malloc(strlen(device)); strcpy(priv->video_device, device); } @@ -265,7 +265,7 @@ static int init(priv_t *priv, tvi_param_t *params) priv->height = priv->capability.minheight; mp_msg(MSGT_TV, MSGL_INFO, " Inputs: %d\n", priv->capability.channels); - priv->channels = malloc(sizeof(struct video_channel)*priv->capability.channels); + priv->channels = (struct video_channel *)malloc(sizeof(struct video_channel)*priv->capability.channels); memset(priv->channels, 0, sizeof(struct video_channel)*priv->capability.channels); for (i = 0; i < priv->capability.channels; i++) { @@ -298,7 +298,7 @@ static int init(priv_t *priv, tvi_param_t *params) priv->mbuf.size, priv->mbuf.frames); priv->mmap = mmap(0, priv->mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, priv->fd, 0); - if (priv->mmap == -1) + if (priv->mmap == (unsigned char *)-1) { mp_msg(MSGT_TV, MSGL_ERR, "Unabel to map memory for buffers: %s\n", strerror(errno)); goto err; @@ -309,7 +309,7 @@ static int init(priv_t *priv, tvi_param_t *params) priv->nbuf = priv->mbuf.frames; /* video buffers */ - priv->buf = malloc(priv->nbuf * sizeof(struct video_mmap)); + priv->buf = (struct video_mmap *)malloc(priv->nbuf * sizeof(struct video_mmap)); memset(priv->buf, 0, priv->nbuf * sizeof(struct video_mmap)); return(1);