@@ -1,334 +0,0 @@
-diff -uNr xine-lib.orig/src/vdr/input_vdr.c xine-lib/src/vdr/input_vdr.c
---- xine-lib.orig/src/vdr/input_vdr.c 2006-12-16 14:15:24.000000000 +0100
-+++ xine-lib/src/vdr/input_vdr.c 2006-12-16 14:15:44.000000000 +0100
-@@ -34,6 +34,10 @@
- #include <errno.h>
- #include <pthread.h>
-
-+#include <sys/socket.h>
-+#include <resolv.h>
-+#include <netdb.h>
-+
- #define LOG_MODULE "input_vdr"
- #define LOG_VERBOSE
- /*
-@@ -49,9 +53,7 @@
-
-
- #define VDR_MAX_NUM_WINDOWS 16
--#define VDR_ABS_FIFO_DIR "/tmp/vdr-xine"
--
--
-+#define VDR_ABS_FIFO_DIR "/var/lib/vdr-xine"
-
- #define BUF_SIZE 1024
-
-@@ -2061,108 +2063,203 @@
-
- static uint8_t preview_data[ sizeof (preview_mpg_data) + ((sizeof (preview_mpg_data) - 1) / (2048 - 6 - 3) + 1) * (6 + 3) ];
-
--static int vdr_plugin_open(input_plugin_t *this_gen)
-+static int vdr_plugin_open_socket(vdr_input_plugin_t *this, struct hostent *host, unsigned short port)
-+{
-+ int fd;
-+ struct sockaddr_in sain;
-+ struct in_addr iaddr;
-+
-+ if ((fd = socket(PF_INET,SOCK_STREAM,0)) == -1) {
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ _("vdr: failed to create socket for port %d (%s)\n"),
-+ port,strerror(errno));
-+ return -1;
-+ }
-+
-+ iaddr.s_addr = * ((unsigned int *) host->h_addr_list[0]);
-+
-+ sain.sin_port = htons(port);
-+ sain.sin_family = AF_INET;
-+ sain.sin_addr = iaddr;
-+
-+ if (connect(fd,(struct sockaddr*) &sain, sizeof(sain)) < 0) {
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ _("vdr: failed to connect to port %d (%s)\n"),port,
-+ strerror(errno));
-+ return -1;
-+ }
-+
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ "vdr: socket opening successful, fd = %d\n",fd);
-+ return fd;
-+}
-+
-+static int vdr_plugin_open_sockets(vdr_input_plugin_t *this)
-+{
-+// struct hostent *host = gethostbyname(VDR_SERVER_ADDRESS);
-+ struct hostent *host = gethostbyname(&this->mrl[12]);
-+
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,"vdr: connecting to vdr.\n");
-+ if (host == NULL) {
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ _("vdr: failed to resolve hostname '%s' (%s)\n"),
-+ &this->mrl[12],
-+ strerror(errno));
-+ return 0;
-+ }
-+
-+ if ((this->fh = vdr_plugin_open_socket(this,host,18701)) == -1)
-+ return 0;
-+
-+ fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
-+
-+ if ((this->fh_control = vdr_plugin_open_socket(this,host,18702)) == -1)
-+ return 0;
-+
-+ if ((this->fh_result = vdr_plugin_open_socket(this,host,18703)) == -1)
-+ return 0;
-+
-+ if ((this->fh_event = vdr_plugin_open_socket(this,host,18704)) == -1)
-+ return 0;
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ "vdr: connecting to all sockets was successful.\n");
-+ return 1;
-+}
-+
-+static int vdr_plugin_open_vdr(input_plugin_t *this_gen)
- {
- vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
-
-- lprintf("trying to open '%s'...\n", this->mrl);
-+ char *filename;
-
-- if (this->fh == -1)
-- {
-- char *filename;
-- int err = 0;
-+ filename = (char *)&this->mrl[ 4 ];
-+ this->fh = open(filename, O_RDONLY | O_NONBLOCK);
-
-- filename = (char *)&this->mrl[ 4 ];
-- this->fh = open(filename, O_RDONLY | O_NONBLOCK);
-+ lprintf("filename '%s'\n", filename);
-
-- lprintf("filename '%s'\n", filename);
-+ if (this->fh == -1)
-+ {
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ _(LOG_MODULE ": failed to open '%s' (%s)\n"),
-+ filename,
-+ strerror(errno));
-+
-+ return 0;
-+ }
-
-- if (this->fh == -1)
-+ {
-+ struct pollfd poll_fh = { this->fh, POLLIN, 0 };
-+
-+ int r = poll(&poll_fh, 1, 300);
-+ if (1 != r)
- {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _(LOG_MODULE ": failed to open '%s' (%s)\n"),
- filename,
-- strerror(errno));
--
-- return 0;
-- }
--
-- {
-- struct pollfd poll_fh = { this->fh, POLLIN, 0 };
--
-- int r = poll(&poll_fh, 1, 300);
-- if (1 != r)
-- {
-- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-- _(LOG_MODULE ": failed to open '%s' (%s)\n"),
-- filename,
-- _("timeout expired during setup phase"));
-+ _("timeout expired during setup phase"));
-
-- return 0;
-- }
-+ return 0;
- }
-+ }
-
-- fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
-+ fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
-
-- {
-- char *filename_control = 0;
-- asprintf(&filename_control, "%s.control", filename);
--
-- this->fh_control = open(filename_control, O_RDONLY);
--
-- if (this->fh_control == -1) {
-- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-- _(LOG_MODULE ": failed to open '%s' (%s)\n"),
-- filename_control,
-- strerror(errno));
-+ {
-+ char *filename_control = 0;
-+ asprintf(&filename_control, "%s.control", filename);
-
-- free(filename_control);
-- return 0;
-- }
-+ this->fh_control = open(filename_control, O_RDONLY);
-
-- free(filename_control);
-+ if (this->fh_control == -1) {
-+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
-+ _(LOG_MODULE ": failed to open '%s' (%s)\n"),
-+ filename_control,
-+ strerror(errno));
-+ free(filename_control);
-+ return 0;
- }
-+ free(filename_control);
-+ }
-
-- {
-- char *filename_result = 0;
-- asprintf(&filename_result, "%s.result", filename);
-+ {
-+ char *filename_result = 0;
-+ asprintf(&filename_result, "%s.result", filename);
-
-- this->fh_result = open(filename_result, O_WRONLY);
-+ this->fh_result = open(filename_result, O_WRONLY);
|