summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/Makefile.am2
-rw-r--r--src/input/input_cdda.c32
-rw-r--r--src/input/input_file.c11
-rw-r--r--src/input/input_net.c15
-rw-r--r--src/input/input_pvr.c8
-rw-r--r--src/input/input_smb.c20
-rw-r--r--src/input/net_buf_ctrl.c4
7 files changed, 70 insertions, 22 deletions
diff --git a/src/input/Makefile.am b/src/input/Makefile.am
index 943be4195..da96bfa06 100644
--- a/src/input/Makefile.am
+++ b/src/input/Makefile.am
@@ -34,11 +34,11 @@ endif
if ENABLE_V4L
in_v4l = xineplug_inp_v4l.la
-in_pvr = xineplug_inp_pvr.la
endif
if ENABLE_V4L2
in_v4l2 = xineplug_inp_v4l2.la
+in_pvr = xineplug_inp_pvr.la
endif
if ENABLE_GNOME_VFS
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 824b97fbb..08229874c 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -210,7 +210,7 @@ typedef struct {
int mrls_allocated_entries;
xine_mrl_t **mrls;
- char *autoplaylist[MAX_TRACKS];
+ char **autoplaylist;
} cdda_input_class_t;
@@ -2436,6 +2436,21 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
return 1;
}
+static void free_autoplay_list(cdda_input_class_t *this)
+{
+ /* free old playlist */
+ if (this->autoplaylist) {
+ unsigned int i;
+ for( i = 0; this->autoplaylist[i]; i++ ) {
+ free( this->autoplaylist[i] );
+ this->autoplaylist[i] = NULL;
+ }
+
+ free(this->autoplaylist);
+ this->autoplaylist = NULL;
+ }
+}
+
static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
int *num_files) {
@@ -2447,11 +2462,7 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
lprintf("cdda_class_get_autoplay_list for >%s<\n", this->cdda_device);
- /* free old playlist */
- for( i = 0; this->autoplaylist[i]; i++ ) {
- free( this->autoplaylist[i] );
- this->autoplaylist[i] = NULL;
- }
+ free_autoplay_list(this);
/* get the CD TOC */
toc = init_cdrom_toc();
@@ -2509,6 +2520,8 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
num_tracks--;
if (num_tracks >= MAX_TRACKS-1)
num_tracks = MAX_TRACKS - 2;
+
+ this->autoplaylist = calloc(num_tracks + 2, sizeof(char *));
for ( i = 0; i <= num_tracks; i++ )
this->autoplaylist[i] = _x_asprintf("cdda:/%d",i+toc->first_track);
@@ -2624,7 +2637,14 @@ static void cdda_class_dispose (input_class_t *this_gen) {
config->unregister_callback(config, "media.audio_cd.drive_slowdown");
#endif
+ free_autoplay_list(this);
+
+ while (this->mrls_allocated_entries) {
+ MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]);
+ free(this->mrls[this->mrls_allocated_entries--]);
+ }
free (this->mrls);
+
free (this);
}
diff --git a/src/input/input_file.c b/src/input/input_file.c
index c2ecd3c0b..796c789d6 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -841,7 +841,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
+ MRL_ZERO(this->mrls[num_files]);
MRL_DUPLICATE(&dir_files[i], this->mrls[num_files]);
@@ -859,7 +859,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
+ MRL_ZERO(this->mrls[num_files]);
MRL_DUPLICATE(&hide_files[i], this->mrls[num_files]);
@@ -877,7 +877,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
- memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
+ MRL_ZERO(this->mrls[num_files]);
MRL_DUPLICATE(&norm_files[i], this->mrls[num_files]);
@@ -945,7 +945,12 @@ static void file_class_dispose (input_class_t *this_gen) {
config->unregister_callback(config, "media.files.origin_path");
+ while(this->mrls_allocated_entries) {
+ MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]);
+ free(this->mrls[this->mrls_allocated_entries--]);
+ }
free (this->mrls);
+
free (this);
}
diff --git a/src/input/input_net.c b/src/input/input_net.c
index cd4a8c901..801093e96 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -113,7 +113,10 @@ typedef struct {
static int host_connect_attempt_ipv4(struct in_addr ia, int port, xine_t *xine) {
int s;
- struct sockaddr_in sin;
+ union {
+ struct sockaddr_in in;
+ struct sockaddr sa;
+ } sa;
s = xine_socket_cloexec(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s==-1) {
@@ -122,14 +125,14 @@ static int host_connect_attempt_ipv4(struct in_addr ia, int port, xine_t *xine)
return -1;
}
- sin.sin_family = AF_INET;
- sin.sin_addr = ia;
- sin.sin_port = htons(port);
+ sa.in.sin_family = AF_INET;
+ sa.in.sin_addr = ia;
+ sa.in.sin_port = htons(port);
#ifndef WIN32
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+ if (connect(s, &sa.sa, sizeof(sa.in))==-1 && errno != EINPROGRESS)
#else
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError() != WSAEINPROGRESS)
+ if (connect(s, &sa.sa, sizeof(sa.in))==-1 && WSAGetLastError() != WSAEINPROGRESS)
#endif
{
xine_log(xine, XINE_LOG_MSG,
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 5e66bee82..0503316da 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -98,7 +98,13 @@
#include <time.h>
#include <pthread.h>
#include <sys/ioctl.h>
-#include <linux/videodev2.h>
+#ifdef HAVE_SYS_VIDEOIO_H
+# include <sys/videoio.h>
+#elif defined(HAVE_SYS_VIDEODEV2_H)
+# include <sys/videodev2.h>
+#else
+# include <linux/videodev2.h>
+#endif
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index b2211e2ae..f3c2c035d 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -345,7 +345,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
(this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}else
- memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
+ MRL_ZERO(this->mrls[num_files]);
MRL_DUPLICATE(&dir_files[i], this->mrls[num_files]);
@@ -362,7 +362,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
(this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}else
- memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
+ MRL_ZERO(this->mrls[num_files]);
MRL_DUPLICATE(&norm_files[i], this->mrls[num_files]);
@@ -440,6 +440,20 @@ smb_plugin_open (input_plugin_t *this_gen )
return 1;
}
+static void
+smb_class_dispose (input_class_t *this_gen)
+{
+ smb_input_class_t *this = (smb_input_class_t *) this_gen;
+
+ while(this->mrls_allocated_entries) {
+ MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]);
+ free(this->mrls[this->mrls_allocated_entries--]);
+ }
+ free(this->mrls);
+
+ free (this);
+}
+
static input_plugin_t *
smb_class_get_instance (input_class_t *class_gen, xine_stream_t *stream,
const char *mrl)
@@ -498,7 +512,7 @@ static void
this->input_class.description = N_("CIFS/SMB input plugin based on libsmbclient");
this->input_class.get_dir = smb_class_get_dir;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = default_input_class_dispose;
+ this->input_class.dispose = smb_class_dispose;
this->input_class.eject_media = NULL;
_exit_error:
diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c
index d50a6a8c4..87054bfaa 100644
--- a/src/input/net_buf_ctrl.c
+++ b/src/input/net_buf_ctrl.c
@@ -158,8 +158,8 @@ static void dvbspeed_init (nbc_t *this) {
#endif
}
if (xine_config_lookup_entry (xine, "engine.buffers.video_num_buffers",
- &entry) && (entry.num_value < 1800)) {
- config->update_num (config, "engine.buffers.video_num_buffers", 1800);
+ &entry) && (entry.num_value < 800)) {
+ config->update_num (config, "engine.buffers.video_num_buffers", 800);
#ifdef LOG_DVBSPEED
printf ("net_buf_ctrl: enlarged video fifo to 1800 buffers\n");
#endif