summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/Makefile.am100
-rw-r--r--src/input/input_cdda.c71
-rw-r--r--src/input/input_dvb.c29
-rw-r--r--src/input/input_dvd.c23
-rw-r--r--src/input/input_file.c6
-rw-r--r--src/input/input_http.c27
-rw-r--r--src/input/input_mms.c14
-rw-r--r--src/input/input_smb.c4
-rw-r--r--src/input/libdvdnav/Makefile.am6
-rw-r--r--src/input/libdvdnav/diff_against_cvs.patch33
-rw-r--r--src/input/libdvdnav/ifo_types.h22
-rw-r--r--src/input/libreal/Makefile.am19
-rw-r--r--src/input/libreal/real.c2
-rw-r--r--src/input/librtsp/Makefile.am16
-rw-r--r--src/input/vcd/Makefile.am27
-rw-r--r--src/input/vcd/libcdio/Makefile.am42
-rw-r--r--src/input/vcd/libvcd/Makefile.am69
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c4
18 files changed, 228 insertions, 286 deletions
diff --git a/src/input/Makefile.am b/src/input/Makefile.am
index a2a1ea3a4..f9f9a9fb8 100644
--- a/src/input/Makefile.am
+++ b/src/input/Makefile.am
@@ -1,12 +1,8 @@
include $(top_srcdir)/misc/Makefile.common
-EXTRA_DIST = input_dvd.c input_vcd.c input_gnome_vfs.c input_rtp.c
-
-if HAVE_DVDNAV
-SUBDIRS = vcd dvb libreal librtsp
-else
-SUBDIRS = vcd dvb libreal librtsp libdvdnav
-endif
+# REVISIT: This second line here bothers me more than just a little bit
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
##
# IMPORTANT:
@@ -14,46 +10,61 @@ endif
# All of xine input plugins should be named like the scheme "xineplug_inp_"
#
-if HAVE_CDROM_IOCTLS
+SUBDIRS = libreal librtsp
+if ENABLE_DVB
+SUBDIRS += dvb
+endif
+if ENABLE_VCD
+SUBDIRS += vcd
+endif
+if !WITH_EXTERNAL_DVDNAV
+SUBDIRS += libdvdnav
+endif
+
+
+xineinclude_HEADERS = input_plugin.h
+noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h videodev2.h http_helper.h
+
+
+if ENABLE_DVB
+in_dvb = xineplug_inp_dvb.la
+endif
+
+if ENABLE_VCDO
in_vcd = xineplug_inp_vcdo.la
endif
-if HAVE_V4L
+if ENABLE_V4L
in_v4l = xineplug_inp_v4l.la
in_pvr = xineplug_inp_pvr.la
endif
-if HAVE_GNOME_VFS
+if ENABLE_GNOME_VFS
in_gnome_vfs = xineplug_inp_gnome_vfs.la
endif
-if HAVE_LIBSMBCLIENT
+if ENABLE_LIBSMBCLIENT
in_smb = xineplug_inp_smb.la
endif
-# For DVD
-in_dvd = xineplug_inp_dvd.la
-if HAVE_DVDNAV
-DVD_CFLAGS = $(DVDNAV_CFLAGS)
+if WITH_EXTERNAL_DVDNAV
+DVD_CFLAGS = $(DVDNAV_CFLAGS)
link_dvdnav = $(DVDNAV_LIBS)
else
-DVD_CFLAGS = -I$(top_srcdir)/src/input/libdvdnav/
+DVD_CFLAGS = -I$(top_srcdir)/src/input/libdvdnav
link_dvdnav = libdvdnav/libdvdnav.la
endif
# not ported to native Windows
-if WIN32
-else
+if !WIN32
in_rtp = xineplug_inp_rtp.la
-in_dvb = xineplug_inp_dvb.la
endif
-AM_CFLAGS = -D_LARGEFILE64_SOURCE $(GNOME_VFS_CFLAGS) $(ALSA_CFLAGS) $(DVD_CFLAGS)
xineplug_LTLIBRARIES = \
xineplug_inp_file.la \
xineplug_inp_http.la \
- $(in_dvd) \
+ xineplug_inp_dvd.la \
$(in_vcd) \
$(in_v4l) \
$(in_gnome_vfs) \
@@ -71,84 +82,55 @@ xineplug_LTLIBRARIES = \
xineplug_inp_file_la_SOURCES = input_file.c
xineplug_inp_file_la_LIBADD = $(XINE_LIB)
-xineplug_inp_file_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_file_la_LDFLAGS = -avoid-version -module
xineplug_inp_dvd_la_SOURCES = input_dvd.c media_helper.c
xineplug_inp_dvd_la_LIBADD = $(XINE_LIB) $(link_dvdnav) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS)
-xineplug_inp_dvd_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_dvd_la_LDFLAGS = -avoid-version -module
+xineplug_inp_dvd_la_CFLAGS = $(AM_CFLAGS) $(DVD_CFLAGS)
xineplug_inp_net_la_SOURCES = input_net.c net_buf_ctrl.c
xineplug_inp_net_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS)
-xineplug_inp_net_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_net_la_LDFLAGS = -avoid-version -module
xineplug_inp_mms_la_SOURCES = input_mms.c net_buf_ctrl.c mms.c mmsh.c http_helper.c ../demuxers/asfheader.c
xineplug_inp_mms_la_LIBADD = $(XINE_LIB) @LIBICONV@ $(PTHREAD_LIBS)
-xineplug_inp_mms_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_mms_la_LDFLAGS = -avoid-version -module
xineplug_inp_vcdo_la_SOURCES = input_vcd.c media_helper.c
xineplug_inp_vcdo_la_LIBADD = $(XINE_LIB)
-xineplug_inp_vcdo_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_vcdo_la_LDFLAGS = -avoid-version -module
xineplug_inp_stdin_fifo_la_SOURCES = input_stdin_fifo.c net_buf_ctrl.c
xineplug_inp_stdin_fifo_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_stdin_fifo_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_stdin_fifo_la_LDFLAGS = -avoid-version -module
xineplug_inp_rtp_la_SOURCES = input_rtp.c net_buf_ctrl.c
xineplug_inp_rtp_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS)
-xineplug_inp_rtp_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_rtp_la_LDFLAGS = -avoid-version -module
xineplug_inp_http_la_SOURCES = input_http.c net_buf_ctrl.c http_helper.c
xineplug_inp_http_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS)
-xineplug_inp_http_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_http_la_LDFLAGS = -avoid-version -module
xineplug_inp_pnm_la_SOURCES = input_pnm.c net_buf_ctrl.c pnm.c
xineplug_inp_pnm_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_pnm_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_pnm_la_LDFLAGS = -avoid-version -module
xineplug_inp_dvb_la_SOURCES = input_dvb.c net_buf_ctrl.c
-xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_dvb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_dvb_la_LDFLAGS = -avoid-version -module
+xineplug_inp_dvb_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(XDG_BASEDIR_LIBS)
+xineplug_inp_dvb_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
xineplug_inp_rtsp_la_SOURCES = input_rtsp.c net_buf_ctrl.c
xineplug_inp_rtsp_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) libreal/libreal.la librtsp/librtsp.la
-xineplug_inp_rtsp_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_rtsp_la_LDFLAGS = -avoid-version -module
xineplug_inp_cdda_la_SOURCES = input_cdda.c media_helper.c sha1.c sha1.h base64.c base64.h
-xineplug_inp_cdda_la_LIBADD = $(XINE_LIB)
-xineplug_inp_cdda_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_cdda_la_LDFLAGS = -avoid-version -module
+xineplug_inp_cdda_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_cdda_la_LIBADD = $(XINE_LIB) $(XDG_BASEDIR_LIBS)
+xineplug_inp_cdda_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
xineplug_inp_v4l_la_SOURCES = input_v4l.c
xineplug_inp_v4l_la_LIBADD = $(ALSA_LIBS) $(XINE_LIB)
-xineplug_inp_v4l_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_v4l_la_LDFLAGS = -avoid-version -module
+xineplug_inp_v4l_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS)
xineplug_inp_gnome_vfs_la_SOURCES = input_gnome_vfs.c net_buf_ctrl.c
xineplug_inp_gnome_vfs_la_LIBADD = $(GNOME_VFS_LIBS) $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_gnome_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_gnome_vfs_la_LDFLAGS = -avoid-version -module
+xineplug_inp_gnome_vfs_la_CFLAGS = $(AM_CFLAGS) $(GNOME_VFS_CFLAGS)
xineplug_inp_smb_la_SOURCES = input_smb.c
xineplug_inp_smb_la_LIBADD = $(LIBSMBCLIENT_LIBS) $(XINE_LIB)
-xineplug_inp_smb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_smb_la_LDFLAGS = -avoid-version -module
xineplug_inp_pvr_la_SOURCES = input_pvr.c
xineplug_inp_pvr_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_pvr_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_pvr_la_LDFLAGS = -avoid-version -module
-
-xineinclude_HEADERS = input_plugin.h
-noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h videodev2.h http_helper.h
-
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 0b1f046e8..80f0bda39 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -41,6 +41,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
@@ -55,6 +58,8 @@
#include <netinet/in.h>
#include <sys/socket.h>
+#include <basedir.h>
+
#define LOG_MODULE "input_cdda"
#define LOG_VERBOSE
/*
@@ -128,7 +133,6 @@ typedef struct {
int enabled;
char *server;
int port;
- char *cache_dir;
char *cdiscid;
char *disc_title;
@@ -1187,15 +1191,6 @@ static void port_changed_cb(void *data, xine_cfg_entry_t *cfg) {
this->cddb.port = cfg->num_value;
}
}
-static void cachedir_changed_cb(void *data, xine_cfg_entry_t *cfg) {
- cdda_input_class_t *class = (cdda_input_class_t *) data;
-
- if(class->ip) {
- cdda_input_plugin_t *this = class->ip;
-
- this->cddb.cache_dir = cfg->str_value;
- }
-}
#ifdef CDROM_SELECT_SPEED
static void speed_changed_cb(void *data, xine_cfg_entry_t *cfg) {
cdda_input_class_t *class = (cdda_input_class_t *) data;
@@ -1337,18 +1332,6 @@ static void _cdda_mkdir_recursive_safe(xine_t *xine, char *path) {
}
/*
- * Where, by default, cddb cache files will be saved
- */
-static char *_cdda_cddb_get_default_location(void) {
- static char buf[XINE_PATH_MAX + XINE_NAME_MAX + 1];
-
- memset(&buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "%s/.xine/cddbcache", (xine_get_homedir()));
-
- return buf;
-}
-
-/*
* Read from socket, fill char *s, return size length.
*/
static int _cdda_cddb_socket_read(cdda_input_plugin_t *this, char *str, int size) {
@@ -1447,15 +1430,18 @@ static int _cdda_cddb_handle_code(char *buf) {
* Try to load cached cddb infos
*/
static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
- char cdir[XINE_PATH_MAX + XINE_NAME_MAX + 1];
+ char *cdir = NULL;
DIR *dir;
+ const char *const xdg_cache_home = xdgCacheHome(this->stream->xine->basedir_handle);
+
if(this == NULL)
return 0;
- memset(&cdir, 0, sizeof(cdir));
- snprintf(cdir, sizeof(cdir), "%s", this->cddb.cache_dir);
-
+ cdir = alloca(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/cddb"));
+ strcpy(cdir, xdg_cache_home);
+ strcat(cdir, "/"PACKAGE"/cddb");
+
if((dir = opendir(cdir)) != NULL) {
struct dirent *pdir;
@@ -1579,20 +1565,24 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
* Save cddb grabbed infos.
*/
static void _cdda_save_cached_cddb_infos(cdda_input_plugin_t *this, char *filecontent) {
- char cfile[XINE_PATH_MAX + XINE_NAME_MAX + 1];
FILE *fd;
-
+ DIR *dir;
+ char *cfile;
+
+ const char *const xdg_cache_home = xdgCacheHome(this->stream->xine->basedir_handle);
+
if((this == NULL) || (filecontent == NULL))
return;
- memset(&cfile, 0, sizeof(cfile));
+ /* the filename is always 8 characters */
+ cfile = alloca(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/cddb") + 9);
+ strcpy(cfile, xdg_cache_home);
+ strcat(cfile, "/"PACKAGE"/cddb");
- /* Ensure "~/.xine/cddbcache" exist */
- snprintf(cfile, sizeof(cfile), "%s", this->cddb.cache_dir);
-
+ /* Ensure the cache directory exists */
_cdda_mkdir_recursive_safe(this->stream->xine, cfile);
- snprintf(cfile, sizeof(cfile), "%s/%08lx", this->cddb.cache_dir, this->cddb.disc_id);
+ sprintf(cfile, "%s/%08lx", cfile, this->cddb.disc_id);
if((fd = fopen(cfile, "w")) == NULL) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
@@ -2463,7 +2453,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
if(this->cddb.num_tracks) {
int t;
- this->cddb.track = (trackinfo_t *) xine_xmalloc(sizeof(trackinfo_t) * this->cddb.num_tracks);
+ this->cddb.track = (trackinfo_t *) xine_xcalloc(this->cddb.num_tracks, sizeof(trackinfo_t));
for(t = 0; t < this->cddb.num_tracks; t++) {
int length = (toc->toc_entries[t].first_frame_minute * CD_SECONDS_PER_MINUTE +
@@ -2689,10 +2679,6 @@ static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_str
&port_entry))
port_changed_cb(class, &port_entry);
- if(xine_config_lookup_entry(this->stream->xine, "media.audio_cd.cddb_cachedir",
- &cachedir_entry))
- cachedir_changed_cb(class, &cachedir_entry);
-
class->cddb_error = cddb_error;
return (input_plugin_t *)this;
@@ -2715,7 +2701,6 @@ static void cdda_class_dispose (input_class_t *this_gen) {
config->unregister_callback(config, "media.audio_cd.use_cddb");
config->unregister_callback(config, "media.audio_cd.cddb_server");
config->unregister_callback(config, "media.audio_cd.cddb_port");
- config->unregister_callback(config, "media.audio_cd.cddb_cachedir");
#ifdef CDROM_SELECT_SPEED
config->unregister_callback(config, "media.audio_cd.drive_slowdown");
#endif
@@ -2784,14 +2769,6 @@ static void *init_plugin (xine_t *xine, void *data) {
"title and track information from."), XINE_CONFIG_SECURITY,
port_changed_cb, (void *) this);
- config->register_filename(config, "media.audio_cd.cddb_cachedir",
- (_cdda_cddb_get_default_location()), XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
- _("CDDB cache directory"), _("The replies from the CDDB server will be "
- "cached in this directory.\nThis setting is security critical, because files "
- "with uncontrollable names will be created in this directory. Be sure to use "
- "a dedicated directory not used for anything but CDDB caching."), XINE_CONFIG_SECURITY,
- cachedir_changed_cb, (void *) this);
-
#ifdef CDROM_SELECT_SPEED
config->register_num(config, "media.audio_cd.drive_slowdown", 4,
_("slow down disc drive to this speed factor"),
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 736b4c6d7..efc3a88d8 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -66,14 +66,17 @@
* OSD - this will allow for filtering/searching of epg data - useful for automatic recording :)
*/
-/* pthread.h must be included first so rest of the headers are imported
- thread safely (on some systems). */
-#include <pthread.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+/* pthread.h must be included first so rest of the headers are imported
+ thread safely (on some systems).
+ However, including it before config.h causes problems with asprintf not
+ being declared (glibc 2.3.6)
+*/
+#include <pthread.h>
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -97,6 +100,9 @@
#endif
#include <ctype.h>
+/* XDG */
+#include <basedir.h>
+
/* These will eventually be #include <linux/dvb/...> */
#include "dvb/dmx.h"
#include "dvb/frontend.h"
@@ -887,8 +893,8 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
int num_alloc = 0;
int i;
struct stat st;
-
- snprintf(filename, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
+
+ snprintf(filename, BUFSIZE, "%s/"PACKAGE"/channels.conf", xdgConfigHome(xine->basedir_handle));
f = fopen(filename, "r");
if (!f) {
@@ -3162,11 +3168,14 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
num_channels = 0;
if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) {
+ static char *placefile = NULL;
/* channels.conf not found in .xine */
- class->mrls[0]="Sorry, No channels.conf found";
- class->mrls[1]="Please run the dvbscan utility";
- class->mrls[2]="from the dvb drivers apps package";
- class->mrls[3]="and place the file in ~/.xine/";
+ class->mrls[0]="Sorry, no channels.conf found.";
+ class->mrls[1]="Please run the scan utility from the DVB";
+ class->mrls[2]="drivers apps package and place the file in";
+ if (!placefile)
+ asprintf (&placefile, "%s/"PACKAGE"/", xdgConfigHome(class->xine->basedir_handle));
+ class->mrls[3]=placefile;
*num_files=4;
return class->mrls;
}
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index de47de0d5..1a8861289 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -158,7 +158,7 @@
# define lseek64 lseek
#endif
-static const char *dvdnav_menu_table[] = {
+static const char *const dvdnav_menu_table[] = {
NULL,
NULL,
"Title",
@@ -1629,7 +1629,7 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
this->mem_stack = 0;
this->mem_stack_max = 1024;
- this->mem = xine_xmalloc(sizeof(unsigned char *) * this->mem_stack_max);
+ this->mem = xine_xcalloc(this->mem_stack_max, sizeof(unsigned char *));
if (!this->mem) {
free(this);
return NULL;
@@ -1791,8 +1791,7 @@ static void *init_class (xine_t *xine, void *data) {
{
/* we have found libdvdcss, enable the specific config options */
char *raw_device;
- static const char *decrypt_modes[] = { "key", "disc", "title", NULL };
- char *css_cache_default, *css_cache;
+ static const char *const decrypt_modes[] = { "key", "disc", "title", NULL };
int mode;
raw_device = config->register_filename(config, "media.dvd.raw_device",
@@ -1817,22 +1816,6 @@ static void *init_class (xine_t *xine, void *data) {
"playing scrambled DVDs."), 20, NULL, NULL);
xine_setenv("DVDCSS_METHOD", decrypt_modes[mode], 0);
- css_cache_default = (char *)malloc(strlen(xine_get_homedir()) + 10);
- sprintf(css_cache_default, "%s/.dvdcss/", xine_get_homedir());
- css_cache = config->register_filename(config, "media.dvd.css_cache_path", css_cache_default, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
- _("path to the title key cache"),
- _("Since cracking the copy protection of scrambled DVDs can "
- "be quite time consuming, libdvdcss will cache the cracked "
- "keys in this directory.\nThis setting is security critical, "
- "because files with uncontrollable names will be created in "
- "this directory. Be sure to use a dedicated directory not "
- "used for anything but DVD key caching."),
- XINE_CONFIG_SECURITY, NULL, NULL);
- if (strlen(css_cache) > 0)
- xine_setenv("DVDCSS_CACHE", css_cache, 0);
- free(css_cache_default);
-
-
if(xine->verbosity > XINE_VERBOSITY_NONE)
xine_setenv("DVDCSS_VERBOSE", "2", 0);
else
diff --git a/src/input/input_file.c b/src/input/input_file.c
index fd2b0e733..0ec25e1f8 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -723,9 +723,9 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
return NULL;
}
- dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- hide_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ hide_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
while((pdirent = readdir(pdir)) != NULL) {
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 6e8932700..d1202ae14 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -93,16 +93,18 @@ typedef struct {
char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
-
+
+ /* 2 spare bytes here */
+
+ /* NSV */
+ unsigned char is_nsv; /* bool */
+
/* ShoutCast */
- int shoutcast_mode;
+ unsigned char shoutcast_mode; /* bool */
int shoutcast_metaint;
off_t shoutcast_pos;
char *shoutcast_songtitle;
- /* NSV */
- int is_nsv;
-
/* scratch buffer for forward seeking */
char seek_buf[BUFSIZE];
@@ -829,7 +831,12 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
return -7;
- } else if (httpcode == 403 || httpcode == 401) {
+ } else if (httpcode == 401) {
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("input_http: http status not 2xx: >%d %s<\n"),
+ httpcode, httpstatus);
+ /* don't return - there may be a WWW-Authenticate header... */
+ } else if (httpcode == 403) {
_x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
@@ -866,6 +873,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
return http_plugin_open(this_gen);
}
+ if (!strncasecmp (this->buf, "WWW-Authenticate: ", 18))
+ strcpy (this->preview, this->buf + 18);
+
+
/* Icecast / ShoutCast Stuff */
if (!strncasecmp(this->buf, TAG_ICY_NAME, sizeof(TAG_ICY_NAME) - 1)) {
_x_meta_info_set(this->stream, XINE_META_INFO_ALBUM,
@@ -925,6 +936,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
lprintf ("end of headers\n");
+ if (httpcode == 401)
+ _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED,
+ this->mrl, *this->preview ? this->preview : NULL, NULL);
+
/*
* fill preview buffer
*/
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index 05c0b168b..739d81a59 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -59,15 +59,15 @@
static const uint32_t mms_bandwidths[]={14400,19200,28800,33600,34430,57600,
115200,262200,393216,524300,1544000,10485800};
-static const char * mms_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)",
- "28.8 Kbps (Modem)", "33.6 Kbps (Modem)",
- "34.4 Kbps (Modem)", "57.6 Kbps (Modem)",
- "115.2 Kbps (ISDN)", "262.2 Kbps (Cable/DSL)",
- "393.2 Kbps (Cable/DSL)","524.3 Kbps (Cable/DSL)",
- "1.5 Mbps (T1)", "10.5 Mbps (LAN)", NULL};
+static const char *const mms_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)",
+ "28.8 Kbps (Modem)", "33.6 Kbps (Modem)",
+ "34.4 Kbps (Modem)", "57.6 Kbps (Modem)",
+ "115.2 Kbps (ISDN)", "262.2 Kbps (Cable/DSL)",
+ "393.2 Kbps (Cable/DSL)","524.3 Kbps (Cable/DSL)",
+ "1.5 Mbps (T1)", "10.5 Mbps (LAN)", NULL};
/* connection methods */
-static const char *mms_protocol_strs[]={"auto", "TCP", "HTTP", NULL};
+static const char *const mms_protocol_strs[]={"auto", "TCP", "HTTP", NULL};
typedef struct {
input_plugin_t input_plugin;
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 1b1f15565..4cacebf89 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -258,8 +258,8 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
}
if ((dir = smbc_opendir(current_path_smb)) >= 0){
- xine_mrl_t *dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- xine_mrl_t *norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ xine_mrl_t *dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ xine_mrl_t *norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
int num_dir_files=0;
int num_norm_files=0;
while ((pdirent = smbc_readdir(dir)) != NULL){
diff --git a/src/input/libdvdnav/Makefile.am b/src/input/libdvdnav/Makefile.am
index 412828261..f741b4f17 100644
--- a/src/input/libdvdnav/Makefile.am
+++ b/src/input/libdvdnav/Makefile.am
@@ -1,6 +1,8 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -DDVDNAV_COMPILE -DHAVE_DLFCN_H
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -DDVDNAV_COMPILE -DHAVE_DLFCN_H
+AM_LDFLAGS = $(xineplug_ldflags)
noinst_LTLIBRARIES = libdvdnav.la
@@ -23,8 +25,6 @@ libdvdnav_la_SOURCES = \
dvd_input.c \
dvd_udf.c
libdvdnav_la_LIBADD = $(PTHREAD_LIBS)
-libdvdnav_la_CFLAGS = $(VISIBILITY_FLAG)
-libdvdnav_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = \
decoder.h \
diff --git a/src/input/libdvdnav/diff_against_cvs.patch b/src/input/libdvdnav/diff_against_cvs.patch
index 202474fef..b9b1dbe8b 100644
--- a/src/input/libdvdnav/diff_against_cvs.patch
+++ b/src/input/libdvdnav/diff_against_cvs.patch
@@ -432,3 +432,36 @@ diff -u -p -u -r1.19 searching.c
if(this->position_current.still != 0) {
printerr("Cannot seek in a still frame.");
+--- src/input/libdvdnav/ifo_types.h Tue Apr 10 13:13:59 2007 +0200
++++ src/input/libdvdnav/ifo_types.h Tue Apr 10 13:38:19 2007 +0200
+@@ -23,2 +25,2 @@
+ #include <inttypes.h>
+ #include "dvd_reader.h"
+
++#include "config.h"
++
+-
+-#undef ATTRIBUTE_PACKED
+-#undef PRAGMA_PACK_BEGIN
+-#undef PRAGMA_PACK_END
+-
+-#if defined(__GNUC__)
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+-#define ATTRIBUTE_PACKED __attribute__ ((packed))
+-#define PRAGMA_PACK 0
+-#endif
+-#endif
+-
+-#if !defined(ATTRIBUTE_PACKED)
+-#define ATTRIBUTE_PACKED
+-#define PRAGMA_PACK 1
+-#endif
+-
+-#if PRAGMA_PACK
+-#pragma pack(1)
+-#endif
+-
++#define ATTRIBUTE_PACKED XINE_PACKED
+
+ /**
+ * Common
diff --git a/src/input/libdvdnav/ifo_types.h b/src/input/libdvdnav/ifo_types.h
index 5d5124579..0935f75d0 100644
--- a/src/input/libdvdnav/ifo_types.h
+++ b/src/input/libdvdnav/ifo_types.h
@@ -23,27 +23,9 @@
#include <inttypes.h>
#include "dvd_reader.h"
+#include "config.h"
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN
-#undef PRAGMA_PACK_END
-
-#if defined(__GNUC__)
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-#if PRAGMA_PACK
-#pragma pack(1)
-#endif
-
+#define ATTRIBUTE_PACKED XINE_PACKED
/**
* Common
diff --git a/src/input/libreal/Makefile.am b/src/input/libreal/Makefile.am
index 5b10d1bca..bd97a7548 100644
--- a/src/input/libreal/Makefile.am
+++ b/src/input/libreal/Makefile.am
@@ -1,19 +1,10 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -I$(srcdir)/../librtsp
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/input/librtsp
-noinst_LTLIBRARIES = libreal.la
-
-libreal_la_SOURCES = \
- real.c \
- asmrp.c \
- rmff.c \
- sdpplin.c
+noinst_HEADERS = real.h asmrp.h rmff.h sdpplin.h
-libreal_la_CFLAGS = $(VISIBILITY_FLAG)
+noinst_LTLIBRARIES = libreal.la
-noinst_HEADERS = \
- real.h \
- asmrp.h \
- rmff.h \
- sdpplin.h
+libreal_la_SOURCES = real.c asmrp.c rmff.c sdpplin.c
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index dc0c001bd..da7c0c443 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -461,7 +461,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
desc->copyright,
desc->abstract);
header->data=rmff_new_dataheader(0,0);
- header->streams = xine_xmalloc(sizeof(rmff_mdpr_t*)*(desc->stream_count+1));
+ header->streams = xine_xcalloc((desc->stream_count+1), sizeof(rmff_mdpr_t*));
lprintf("number of streams: %u\n", desc->stream_count);
for (i=0; i<desc->stream_count; i++) {
diff --git a/src/input/librtsp/Makefile.am b/src/input/librtsp/Makefile.am
index bb85f9cf4..68d554c2c 100644
--- a/src/input/librtsp/Makefile.am
+++ b/src/input/librtsp/Makefile.am
@@ -1,16 +1,10 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -I$(srcdir)/../libreal
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/input/libreal
-noinst_LTLIBRARIES = librtsp.la
-
-librtsp_la_SOURCES = \
- rtsp.c \
- rtsp_session.c
+noinst_HEADERS = rtsp.h rtsp_session.h
-librtsp_la_CFLAGS = $(VISIBILITY_FLAG)
-librtsp_la_LDFLAGS = -avoid-version -module
+noinst_LTLIBRARIES = librtsp.la
-noinst_HEADERS = \
- rtsp.h \
- rtsp_session.h
+librtsp_la_SOURCES = rtsp.c rtsp_session.c
diff --git a/src/input/vcd/Makefile.am b/src/input/vcd/Makefile.am
index 16eece779..3de899f7e 100644
--- a/src/input/vcd/Makefile.am
+++ b/src/input/vcd/Makefile.am
@@ -1,24 +1,17 @@
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = libcdio libvcd
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
-vcd_SRCS = xineplug_inp_vcd.c vcdplayer.c vcdio.c xine-extra.c
+SUBDIRS =
+if !WITH_EXTERNAL_VCDLIBS
+SUBDIRS += libcdio libvcd
+endif
-EXTRA_DIST = $(vcd_SRCS)
+noinst_HEADERS = vcdio.h vcdplayer.h xine-extra.h
-if ENABLE_VCD
xineplug_LTLIBRARIES = xineplug_inp_vcd.la
-AM_CFLAGS = $(LIBCDIO_CFLAGS) $(LIBVCD_CFLAGS)
-
-xineplug_inp_vcd_la_SOURCES = $(vcd_SRCS)
-xineplug_inp_vcd_la_LDFLAGS = -avoid-version -module
-if HAVE_VCDNAV
-xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LIBVCDINFO_LIBS)
-else
-xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LIBVCD_LIBS) $(LIBVCDINFO_LIBS) -lm
-endif
-
-endif
-
-noinst_HEADERS = vcdio.h vcdplayer.h xine-extra.h
+xineplug_inp_vcd_la_SOURCES = xineplug_inp_vcd.c vcdplayer.c vcdio.c xine-extra.c
+xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LIBCDIO_LIBS) $(LIBVCD_LIBS) $(LIBVCDINFO_LIBS) $(LIBISO9660_LIBS) -lm
+xineplug_inp_vcd_la_CFLAGS = $(AM_CFLAGS) $(LIBCDIO_CFLAGS) $(LIBVCD_CFLAGS)
diff --git a/src/input/vcd/libcdio/Makefile.am b/src/input/vcd/libcdio/Makefile.am
index c7415e787..a79525c8f 100644
--- a/src/input/vcd/libcdio/Makefile.am
+++ b/src/input/vcd/libcdio/Makefile.am
@@ -1,10 +1,24 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
SUBDIRS = cdio MSWindows image
-INCLUDES = $(LIBCDIO_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/lib -I$(top_builddir)/lib
+INCLUDES = $(LIBCDIO_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/lib -I$(top_builddir)/lib
+
+noinst_HEADERS = \
+ cdio_assert.h \
+ _cdio_stdio.h \
+ scsi_mmc.h \
+ cdio_private.h \
+ _cdio_stream.h \
+ iso9660_private.h \
+ portable.h
+
+noinst_LTLIBRARIES = libcdio.la libiso9660.la
-libcdio_SRCS = \
+libcdio_la_SOURCES = \
_cdio_bsdi.c \
_cdio_generic.c \
_cdio_linux.c \
@@ -41,30 +55,8 @@ libcdio_SRCS = \
sector.c \
util.c
-libiso9660_SRCS = \
+libiso9660_la_SOURCES = \
iso9660.c \
iso9660_private.h \
iso9660_fs.c \
xa.c
-
-EXTRA_DIST = $(libcdio_SRCS) $(libiso9660_SRCS)
-
-if ENABLE_VCD
-if HAVE_VCDNAV
-else
-noinst_LTLIBRARIES = libcdio.la libiso9660.la
-libcdio_la_SOURCES = $(libcdio_SRCS)
-libcdio_la_LDFLAGS = -avoid-version -module
-libiso9660_la_SOURCES = $(libiso9660_SRCS)
-libiso9660_la_LDFLAGS = -avoid-version -module
-endif
-endif
-
-noinst_HEADERS = \
- cdio_assert.h \
- _cdio_stdio.h \
- scsi_mmc.h \
- cdio_private.h \
- _cdio_stream.h \
- iso9660_private.h \
- portable.h
diff --git a/src/input/vcd/libvcd/Makefile.am b/src/input/vcd/libvcd/Makefile.am
index 01b100aa4..c922685e3 100644
--- a/src/input/vcd/libvcd/Makefile.am
+++ b/src/input/vcd/libvcd/Makefile.am
@@ -1,10 +1,35 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/lib -I$(top_builddir)/lib
+
SUBDIRS = libvcd
-INCLUDES = $(LIBCDIO_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/lib
+noinst_HEADERS = \
+ vcd_assert.h \
+ data_structures.h \
+ info_private.h \
+ pbc.h \
+ stream_stdio.h \
+ bitvec.h \
+ dict.h \
+ mpeg.h \
+ salloc.h \
+ util.h \
+ bytesex_asm.h \
+ directory.h \
+ mpeg_stream.h \
+ sector_private.h \
+ vcd.h \
+ bytesex.h \
+ image_sink.h \
+ obj.h \
+ stream.h \
+ vcd_read.h
-libvcd_SRCS = \
+noinst_LTLIBRARIES = libvcd.la libvcdinfo.la
+libvcd_la_SOURCES = \
vcd.c \
data_structures.c \
directory.c \
@@ -22,45 +47,11 @@ libvcd_SRCS = \
stream.c \
stream_stdio.c \
util.c
+libvcd_la_CFLAGS = $(AM_CFLAGS) $(LIBCDIO_CFLAGS)
-libvcdinfo_SRCS = \
+libvcdinfo_la_SOURCES = \
info.c \
inf.c \
info_private.c \
vcd_read.c
-
-EXTRA_DIST = $(libvcd_SRCS) $(libvcdinfo_SRCS)
-
-if ENABLE_VCD
-if HAVE_VCDNAV
-else
-noinst_LTLIBRARIES = libvcd.la libvcdinfo.la
-libvcd_la_SOURCES = $(libvcd_SRCS)
-libvcd_la_LDFLAGS = -avoid-version -module
-libvcd_la_LIBADD = $(LIBCDIO_LIBS) $(LIBISO9660_LIBS)
-libvcdinfo_la_SOURCES = $(libvcdinfo_SRCS)
-libvcdinfo_la_LDFLAGS = -avoid-version -module
-endif
-endif
-
-noinst_HEADERS = \
- vcd_assert.h \
- data_structures.h \
- info_private.h \
- pbc.h \
- stream_stdio.h \
- bitvec.h \
- dict.h \
- mpeg.h \
- salloc.h \
- util.h \
- bytesex_asm.h \
- directory.h \
- mpeg_stream.h \
- sector_private.h \
- vcd.h \
- bytesex.h \
- image_sink.h \
- obj.h \
- stream.h \
- vcd_read.h
+libvcdinfo_la_CFLAGS = $(AM_CFLAGS) $(LIBCDIO_CFLAGS)
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 9eb9ac996..0f1c9225e 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -1813,13 +1813,13 @@ vcd_init (xine_t *xine, void *data)
/*Note: these labels have to be listed in the same order as the
enumeration vcdplayer_autoplay_t in vcdplayer.h.
*/
- static const char *autoplay_modes[] =
+ static const char *const autoplay_modes[] =
{ "MPEG track", "entry", "segment", "playback-control item", NULL };
/*Note: these labels have to be listed in the same order as the
enumeration vcdplayer_slider_length_t in vcdplayer.h.
*/
- static const char *length_reporting_modes[] =
+ static const char *const length_reporting_modes[] =
{ "auto", "track", "entry", NULL };
my_vcd.player.default_autoplay =