[-]
[+]
|
Changed |
xine-lib.spec
|
|
[-]
[+]
|
Added |
libxine1-ffmpeg.diff
^
|
@@ -0,0 +1,2721 @@
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ff_audio_decoder.c xine-lib-1.1.8/src/libffmpeg/ff_audio_decoder.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ff_audio_decoder.c 2007-08-19 01:36:49.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ff_audio_decoder.c 2007-11-11 00:31:03.000000000 +0100
+@@ -15,12 +15,9 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: audio_decoder.c,v 1.33 2007/01/28 18:38:33 miguelfreitas Exp $
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine audio decoder plugin using ffmpeg
+- *
+ */
+
+ #ifdef HAVE_CONFIG_H
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ff_dvaudio_decoder.c xine-lib-1.1.8/src/libffmpeg/ff_dvaudio_decoder.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ff_dvaudio_decoder.c 2007-08-19 01:36:49.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ff_dvaudio_decoder.c 2007-11-11 00:31:03.000000000 +0100
+@@ -15,12 +15,9 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: dvaudio_decoder.c,v 1.12 2006/12/04 22:25:13 miguelfreitas Exp $
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * dv audio decoder based on patch by Dan Dennedy <dan@dennedy.org>
+- *
+ */
+
+ #ifdef HAVE_CONFIG_H
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_decoder.c xine-lib-1.1.8/src/libffmpeg/ffmpeg_decoder.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_decoder.c 2007-08-19 01:36:50.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ffmpeg_decoder.c 2007-11-11 00:31:03.000000000 +0100
+@@ -15,12 +15,9 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: xine_decoder.c,v 1.173 2007/01/13 21:19:52 miguelfreitas Exp $
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine decoder plugin using ffmpeg
+- *
+ */
+
+ #ifdef HAVE_CONFIG_H
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_decoder.h xine-lib-1.1.8/src/libffmpeg/ffmpeg_decoder.h
+--- xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_decoder.h 2007-08-19 01:36:50.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ffmpeg_decoder.h 2007-11-11 00:31:03.000000000 +0100
+@@ -15,10 +15,7 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: xine_decoder.h,v 1.7 2006/08/02 07:15:27 tmmm Exp $
+- *
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+ #ifndef HAVE_XINE_DECODER_H
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_encoder.c xine-lib-1.1.8/src/libffmpeg/ffmpeg_encoder.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ffmpeg_encoder.c 2007-08-19 01:36:50.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ffmpeg_encoder.c 2007-12-07 19:26:33.000000000 +0100
+@@ -15,9 +15,7 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: xine_encoder.c,v 1.25 2006/07/10 22:08:29 dgp85 Exp $
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+ /* mpeg encoders for the dxr3 video out plugin. */
+@@ -76,7 +74,7 @@
+ lavc_data_t* this;
+ avcodec_init();
+
+- register_avcodec(&mpeg1video_encoder);
++ avcodec_register_all();
+ lprintf("lavc init , version %x\n", avcodec_version());
+ this = xine_xmalloc(sizeof(lavc_data_t));
+ if (!this) return 0;
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ff_mpeg_parser.c xine-lib-1.1.8/src/libffmpeg/ff_mpeg_parser.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ff_mpeg_parser.c 2007-08-19 01:36:49.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ff_mpeg_parser.c 2007-11-11 00:31:03.000000000 +0100
+@@ -15,12 +15,10 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr)
+ * based on libmpeg2 decoder.
+- *
+- * $Id: mpeg_parser.c,v 1.7 2007/03/29 18:52:45 dgp85 Exp $
+ */
+ #define LOG_MODULE "mpeg_parser"
+ #define LOG_VERBOSE
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ff_mpeg_parser.h xine-lib-1.1.8/src/libffmpeg/ff_mpeg_parser.h
+--- xine-lib-1.1.8.orig/src/libffmpeg/ff_mpeg_parser.h 2007-08-19 01:36:49.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ff_mpeg_parser.h 2007-11-11 00:31:03.000000000 +0100
+@@ -15,12 +15,10 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr)
+ * based on libmpeg2 decoder.
+- *
+- * $Id: mpeg_parser.h,v 1.5 2007/03/29 18:52:45 dgp85 Exp $
+ */
+ #ifndef HAVE_MPEG_PARSER_H
+ #define HAVE_MPEG_PARSER_H
+diff -uNr xine-lib-1.1.8.orig/src/libffmpeg/ff_video_decoder.c xine-lib-1.1.8/src/libffmpeg/ff_video_decoder.c
+--- xine-lib-1.1.8.orig/src/libffmpeg/ff_video_decoder.c 2007-08-19 01:36:49.000000000 +0200
++++ xine-lib-1.1.8/src/libffmpeg/ff_video_decoder.c 2007-12-09 16:35:05.000000000 +0100
+@@ -15,12 +15,9 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+- *
+- * $Id: video_decoder.c,v 1.73 2007/03/29 18:41:02 dgp85 Exp $
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine video decoder plugin using ffmpeg
+- *
+ */
+
+ #ifdef HAVE_CONFIG_H
+@@ -67,6 +64,7 @@
+ video_decoder_class_t decoder_class;
+
+ int pp_quality;
++ int thread_count;
+
+ xine_t *xine;
+ } ff_video_class_t;
+@@ -87,6 +85,7 @@
+ uint8_t yuv_init:1;
+ uint8_t is_direct_rendering_disabled:1;
+ uint8_t cs_convert_init:1;
++ uint8_t assume_bad_field_picture:1;
+
+ xine_bmiheader bih;
+ unsigned char *buf;
+@@ -216,12 +215,14 @@
+ ff_video_decoder_t *this = (ff_video_decoder_t *)context->opaque;
+
+ if (av_frame->type == FF_BUFFER_TYPE_USER) {
+- vo_frame_t *img = (vo_frame_t *)av_frame->opaque;
++ if ( av_frame->opaque ) {
++ vo_frame_t *img = (vo_frame_t *)av_frame->opaque;
++
++ img->free(img);
++ }
++
+ xine_list_iterator_t it;
+
+- assert(av_frame->opaque);
+- img->free(img);
+-
+ it = xine_list_find(this->dr1_frames, av_frame);
+ assert(it);
+ if( it != NULL )
+@@ -244,6 +245,7 @@
+ {BUF_VIDEO_WMV7, CODEC_ID_WMV1, "MS Windows Media Video 7 (ffmpeg)"},
+ {BUF_VIDEO_WMV8, CODEC_ID_WMV2, "MS Windows Media Video 8 (ffmpeg)"},
+ {BUF_VIDEO_WMV9, CODEC_ID_WMV3, "MS Windows Media Video 9 (ffmpeg)"},
++ {BUF_VIDEO_VC1, CODEC_ID_VC1, "MS Windows Media Video VC-1 (ffmpeg)"},
+ {BUF_VIDEO_MPEG4, CODEC_ID_MPEG4, "ISO MPEG-4 (ffmpeg)"},
+ {BUF_VIDEO_XVID, CODEC_ID_MPEG4, "ISO MPEG-4 (XviD, ffmpeg)"},
+ {BUF_VIDEO_DIVX5, CODEC_ID_MPEG4, "ISO MPEG-4 (DivX5, ffmpeg)"},
+@@ -368,6 +370,12 @@
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ }
++
++ if (this->class->thread_count > 1) {
++ avcodec_thread_init(this->context, this->class->thread_count);
++ this->context->thread_count = this->class->thread_count;
++ }
++
+ pthread_mutex_unlock(&ffmpeg_lock);
+
+ lprintf("lavc decoder opened\n");
+@@ -418,10 +426,19 @@
+ case BUF_VIDEO_HUFFYUV:
+ this->frame_flags |= VO_INTERLACED_FLAG;
|
[-]
[+]
|
Added |
vdr-xine-lib-0.7.12.diff
^
|
@@ -0,0 +1,5124 @@
+diff -uNr xine-lib.orig/configure.ac xine-lib/configure.ac
+--- xine-lib.orig/configure.ac 2007-09-07 20:50:12.000000000 +0200
++++ xine-lib/configure.ac 2007-10-21 09:39:06.000000000 +0200
+@@ -2692,6 +2692,7 @@
+ src/video_out/vidix/drivers/Makefile
+ src/xine-utils/Makefile
+ src/xine-engine/Makefile
++src/vdr/Makefile
+ win32/Makefile
+ win32/include/Makefile])
+ AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/relchk.sh]],[[]])
+@@ -2727,7 +2728,7 @@
+ echo " - stdin_fifo - rtp"
+ echo " - http - mms"
+ echo " - pnm - rtsp"
+-echo " - dvb"
++echo " - dvb - vdr"
+ if test "x$external_dvdnav" = "xyes"; then
+ echo " - dvd (external libs)"
+ else
+@@ -2927,6 +2928,7 @@
+ echo " - eq - eq2"
+ echo " - boxblur - denoise3d"
+ echo " - unsharp - tvtime"
++echo " - vdr"
+ echo " * SFX:"
+ echo " - goom - oscope"
+ echo " - fftscope - mosaico"
+diff -uNr xine-lib.orig/include/xine.h.in xine-lib/include/xine.h.in
+--- xine-lib.orig/include/xine.h.in 2007-08-17 19:11:39.000000000 +0200
++++ xine-lib/include/xine.h.in 2007-10-21 09:39:06.000000000 +0200
+@@ -1663,6 +1663,7 @@
+ #define XINE_EVENT_VDR_AUDIO 332
+ #define XINE_EVENT_VDR_INFO 333
+ #define XINE_EVENT_VDR_CHANNELPREVIOUS 334
++#define XINE_EVENT_VDR_SUBTITLES 335
+ /* some space for further keys */
+ #define XINE_EVENT_VDR_SETVIDEOWINDOW 350
+ #define XINE_EVENT_VDR_FRAMESIZECHANGED 351
+diff -uNr xine-lib.orig/src/libffmpeg/libavcodec/h264.c xine-lib/src/libffmpeg/libavcodec/h264.c
+--- xine-lib.orig/src/libffmpeg/libavcodec/h264.c 2007-04-17 20:46:43.000000000 +0200
++++ xine-lib/src/libffmpeg/libavcodec/h264.c 2007-10-21 09:39:33.000000000 +0200
+@@ -4639,8 +4639,11 @@
+ s->picture_structure= PICT_FRAME;
+ }else{
+ if(get_bits1(&s->gb)) { //field_pic_flag
+- s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
++ //s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
+ av_log(h->s.avctx, AV_LOG_ERROR, "PAFF interlacing is not implemented\n");
++ s->avctx->release_buffer(s->avctx, (AVFrame*)s->current_picture_ptr);
++ s->current_picture_ptr = 0;
++ return -1;
+ } else {
+ s->picture_structure= PICT_FRAME;
+ h->mb_aff_frame = h->sps.mb_aff;
+@@ -4696,8 +4699,12 @@
+ if(h->slice_type == P_TYPE || h->slice_type == SP_TYPE || h->slice_type == B_TYPE){
+ if(h->slice_type == B_TYPE){
+ h->direct_spatial_mv_pred= get_bits1(&s->gb);
+- if(h->sps.mb_aff && h->direct_spatial_mv_pred)
++ if(h->sps.mb_aff && h->direct_spatial_mv_pred){
+ av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF + spatial direct mode is not implemented\n");
++ s->avctx->release_buffer(s->avctx, (AVFrame*)s->current_picture_ptr);
++ s->current_picture_ptr = 0;
++ return -1;
++ }
+ }
+ num_ref_idx_active_override_flag= get_bits1(&s->gb);
+
+@@ -8110,10 +8117,10 @@
+ }
+
+ ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
+- if (ptr==NULL || dst_length <= 0){
++ if (ptr==NULL || dst_length < 0){
+ return -1;
+ }
+- while(ptr[dst_length - 1] == 0 && dst_length > 1)
++ while(ptr[dst_length - 1] == 0 && dst_length > 0)
+ dst_length--;
+ bit_length= 8*dst_length - decode_rbsp_trailing(ptr + dst_length - 1);
+
+diff -uNr xine-lib.orig/src/libffmpeg/libavcodec/mpegvideo.c xine-lib/src/libffmpeg/libavcodec/mpegvideo.c
+--- xine-lib.orig/src/libffmpeg/libavcodec/mpegvideo.c 2007-06-14 19:59:48.000000000 +0200
++++ xine-lib/src/libffmpeg/libavcodec/mpegvideo.c 2007-10-21 09:39:33.000000000 +0200
+@@ -1544,7 +1544,7 @@
+ AVFrame *pic;
+ s->mb_skipped = 0;
+
+- assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
++// assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
+
+ /* mark&release old frames */
+ if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
+@@ -1619,7 +1619,7 @@
+ goto alloc;
+ }
+
+- assert(s->pict_type == I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
++// assert(s->pict_type == I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
+
+ if(s->picture_structure!=PICT_FRAME){
+ int i;
+diff -uNr xine-lib.orig/src/Makefile.am xine-lib/src/Makefile.am
+--- xine-lib.orig/src/Makefile.am 2007-04-17 20:46:41.000000000 +0200
++++ xine-lib/src/Makefile.am 2007-10-21 09:39:06.000000000 +0200
+@@ -26,4 +26,5 @@
+ libfaad \
+ libmusepack \
+ post \
+- combined
++ combined \
++ vdr
+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 1970-01-01 01:00:00.000000000 +0100
++++ xine-lib/src/vdr/input_vdr.c 2007-10-21 09:39:33.000000000 +0200
+@@ -0,0 +1,2546 @@
++/*
++ * Copyright (C) 2003-2004 the xine project
++ *
++ * This file is part of xine, a free video player.
++ *
++ * xine is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * xine is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
++ *
++ * $Id: input_vdr.c,v 1.51 2003/05/02 15:02:11 miguelfreitas Exp $
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <fcntl.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#include <sys/poll.h>
++#include <errno.h>
++#include <pthread.h>
++
++#define LOG_MODULE "input_vdr"
++#define LOG_VERBOSE
++/*
++#define LOG
++*/
++#include "xine_internal.h"
++#include "xineutils.h"
++#include "input_plugin.h"
++
++#include "input_vdr.h"
++#include "post_vdr.h"
++
++
++
++#define VDR_MAX_NUM_WINDOWS 16
++#define VDR_ABS_FIFO_DIR "/tmp/vdr-xine"
++
++
++
++#define BUF_SIZE 1024
++
++#define LOG_OSD(x)
++/*
++#define LOG_OSD(x) x
++*/
++
++
++typedef struct
++{
++ input_plugin_t input_plugin;
++
++ xine_stream_t *stream;
++ xine_stream_t *stream_external;
++
++ int fh;
++ int fh_control;
++ int fh_result;
++ int fh_event;
++
++ char *mrl;
++
++ off_t curpos;
++ char seek_buf[ BUF_SIZE ];
++
++ char *preview;
++ off_t preview_size;
|
[-]
[+]
|
Added |
vdr-xine-lib-with-sockets-0.7.12.diff
^
|
@@ -0,0 +1,343 @@
+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 2007-10-21 10:08:28.000000000 +0200
++++ xine-lib/src/vdr/input_vdr.c 2007-10-21 10:18:06.000000000 +0200
+@@ -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
+
+@@ -2115,108 +2117,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);
|