summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_dvb.c45
-rw-r--r--src/input/input_dvd.c4
-rw-r--r--src/input/input_gnome_vfs.c2
-rw-r--r--src/input/input_v4l.c4
-rw-r--r--src/input/mms.c4
-rw-r--r--src/input/mmsh.c4
-rw-r--r--src/input/net_buf_ctrl.c4
7 files changed, 36 insertions, 31 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index b35f35fa6..146185845 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -234,9 +234,8 @@ typedef struct {
int adapter_num;
- char frontend_device[100];
- char dvr_device[100];
- char demux_device[100];
+ char *dvr_device;
+ char *demux_device;
struct dmx_pes_filter_params pesFilterParams[MAX_FILTERS];
struct dmx_pes_filter_params subFilterParams[MAX_SUBTITLES];
@@ -359,7 +358,7 @@ typedef struct {
} dvb_input_plugin_t;
typedef struct {
- char *name;
+ const char *name;
int value;
} Param;
@@ -548,9 +547,10 @@ static void tuner_dispose(tuner_t * this)
for (x = 0; x < MAX_SUBTITLES; x++)
if (this->fd_subfilter[x] >= 0)
close(this->fd_subfilter[x]);
-
- if(this)
- free(this);
+
+ free(this->dvr_device);
+ free(this->demux_device);
+ free(this);
}
@@ -560,10 +560,9 @@ static tuner_t *tuner_init(xine_t * xine, int adapter)
tuner_t *this;
int x;
int test_video;
- char *video_device=xine_xmalloc(200);
+ char *video_device = NULL;
+ char *frontend_device = NULL;
- _x_assert(video_device != NULL);
-
this = (tuner_t *) xine_xmalloc(sizeof(tuner_t));
_x_assert(this != NULL);
@@ -576,21 +575,24 @@ static tuner_t *tuner_init(xine_t * xine, int adapter)
this->xine = xine;
this->adapter_num = adapter;
- snprintf(this->frontend_device,100,"/dev/dvb/adapter%i/frontend0",this->adapter_num);
- snprintf(this->demux_device,100,"/dev/dvb/adapter%i/demux0",this->adapter_num);
- snprintf(this->dvr_device,100,"/dev/dvb/adapter%i/dvr0",this->adapter_num);
- snprintf(video_device,100,"/dev/dvb/adapter%i/video0",this->adapter_num);
-
- if ((this->fd_frontend = open(this->frontend_device, O_RDWR)) < 0) {
+ asprintf(&this->demux_device,"/dev/dvb/adapter%i/demux0",this->adapter_num);
+ asprintf(&this->dvr_device,"/dev/dvb/adapter%i/dvr0",this->adapter_num);
+ asprintf(&video_device,"/dev/dvb/adapter%i/video0",this->adapter_num);
+
+ asprintf(&frontend_device,"/dev/dvb/adapter%i/frontend0",this->adapter_num);
+ if ((this->fd_frontend = open(frontend_device, O_RDWR)) < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "FRONTEND DEVICE: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
+ free(frontend_device); frontend_device = NULL;
if ((ioctl(this->fd_frontend, FE_GET_INFO, &this->feinfo)) < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "FE_GET_INFO: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
for (x = 0; x < MAX_FILTERS; x++) {
@@ -598,7 +600,8 @@ static tuner_t *tuner_init(xine_t * xine, int adapter)
if (this->fd_pidfilter[x] < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "DEMUX DEVICE PIDfilter: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
}
for (x = 0; x < MAX_SUBTITLES; x++) {
@@ -630,7 +633,9 @@ static tuner_t *tuner_init(xine_t * xine, int adapter)
close(test_video);
}
+ exit:
free(video_device);
+ free(frontend_device);
return this;
}
@@ -1591,7 +1596,7 @@ static void load_epg_data(dvb_input_plugin_t *this)
case 0x54: { /* Content Descriptor, riveting stuff */
int content_bits = getbits(eit, 8, 4);
- char *content[] = {
+ static const char *const content[] = {
"UNKNOWN","MOVIE","NEWS","ENTERTAINMENT","SPORT",
"CHILDRENS","MUSIC","ARTS/CULTURE","CURRENT AFFAIRS",
"EDUCATIONAL","INFOTAINMENT","SPECIAL","COMEDY","DRAMA",
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 3c06bdec5..60f58d361 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -1621,12 +1621,12 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_stream_t *stream, const char *data) {
dvd_input_plugin_t *this;
dvd_input_class_t *class = (dvd_input_class_t*)class_gen;
- static char *handled_mrl = "dvd:/";
+ static const char handled_mrl[] = "dvd:/";
trace_print("Called\n");
/* Check we can handle this MRL */
- if (strncasecmp (data, handled_mrl, strlen(handled_mrl) ) != 0)
+ if (strncasecmp (data, handled_mrl, sizeof(handled_mrl)-1 ) != 0)
return NULL;
this = (dvd_input_plugin_t *) xine_xmalloc (sizeof (dvd_input_plugin_t));
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index e93a747ee..968945023 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -291,7 +291,7 @@ gnomevfs_klass_dispose (input_class_t *this_gen)
g_free (this);
}
-static const char *const ignore_scheme[] = { "cdda", "file", "http" };
+static const char ignore_scheme[][8] = { "cdda", "file", "http" };
static input_plugin_t *
gnomevfs_klass_get_instance (input_class_t *klass_gen, xine_stream_t *stream,
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 58f982da6..162e2f7ab 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -110,8 +110,8 @@ static const resolution_t resolutions[] = {
{ 160, 120 }
};
-static char *tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
-static int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
+static const char *const tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
+static const int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
#define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0]))
#define RADIO_DEV "/dev/v4l/radio0"
diff --git a/src/input/mms.c b/src/input/mms.c
index ccc56b094..37e7ff395 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -532,7 +532,7 @@ static int interp_asf_header (mms_t *this) {
return 1;
}
-static const char *const mmst_proto_s[] = { "mms", "mmst", NULL };
+static const char mmst_proto_s[][8] = { "mms", "mmst", "" };
static int mmst_valid_proto (char *proto) {
int i = 0;
@@ -542,7 +542,7 @@ static int mmst_valid_proto (char *proto) {
if (!proto)
return 0;
- while(mmst_proto_s[i]) {
+ while(*(mmst_proto_s[i])) {
if (!strcasecmp(proto, mmst_proto_s[i])) {
return 1;
}
diff --git a/src/input/mmsh.c b/src/input/mmsh.c
index f6bf0bcb6..3a33e8d7f 100644
--- a/src/input/mmsh.c
+++ b/src/input/mmsh.c
@@ -447,7 +447,7 @@ static int interp_header (mmsh_t *this) {
return 1;
}
-static const char *const mmsh_proto_s[] = { "mms", "mmsh", NULL };
+static const char mmsh_proto_s[][8] = { "mms", "mmsh", "" };
static int mmsh_valid_proto (char *proto) {
int i = 0;
@@ -457,7 +457,7 @@ static int mmsh_valid_proto (char *proto) {
if (!proto)
return 0;
- while(mmsh_proto_s[i]) {
+ while(*(mmsh_proto_s[i])) {
if (!strcasecmp(proto, mmsh_proto_s[i])) {
return 1;
}
diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c
index 624af4081..aaf575e40 100644
--- a/src/input/net_buf_ctrl.c
+++ b/src/input/net_buf_ctrl.c
@@ -118,8 +118,8 @@ void nbc_check_buffers (nbc_t *this) {
}
static void display_stats (nbc_t *this) {
- const char *buffering[2] = {" ", "buf"};
- const char *enabled[2] = {"off", "on "};
+ static const char buffering[2][4] = {" ", "buf"};
+ static const char enabled[2][4] = {"off", "on "};
printf("bufing: %d, enb: %d\n", this->buffering, this->enabled);
printf("net_buf_ctrl: vid %3d%% %4.1fs %4" PRId64 "kbps %1d, "\