changeset 2819:2e58962dc9fe

cleaned up some warnings, and tv_param_on moved out from #ifdef USE_TV
author alex
date Sun, 11 Nov 2001 03:53:42 +0000
parents 9f68d309f8cb
children 30756e47846a
files libmpdemux/tv.c libmpdemux/tv.h libmpdemux/tvi_def.h libmpdemux/tvi_v4l.c
diffstat 4 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/tv.c	Sun Nov 11 03:40:16 2001 +0000
+++ b/libmpdemux/tv.c	Sun Nov 11 03:53:42 2001 +0000
@@ -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;
--- a/libmpdemux/tv.h	Sun Nov 11 03:40:16 2001 +0000
+++ b/libmpdemux/tv.h	Sun Nov 11 03:53:42 2001 +0000
@@ -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;
--- a/libmpdemux/tvi_def.h	Sun Nov 11 03:40:16 2001 +0000
+++ b/libmpdemux/tvi_def.h	Sun Nov 11 03:53:42 2001 +0000
@@ -21,7 +21,7 @@
 
 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);
--- a/libmpdemux/tvi_v4l.c	Sun Nov 11 03:40:16 2001 +0000
+++ b/libmpdemux/tvi_v4l.c	Sun Nov 11 03:53:42 2001 +0000
@@ -206,12 +206,12 @@
     /* 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 @@
     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 @@
 	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 @@
     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);