mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
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
This commit is contained in:
parent
ef74ccaad0
commit
92af740b72
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user