diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/Makefile.am | 6 | ||||
-rw-r--r-- | src/input/input_cdda.c | 10 | ||||
-rw-r--r-- | src/input/input_dvb.c | 2 | ||||
-rw-r--r-- | src/input/input_dvd.c | 10 | ||||
-rw-r--r-- | src/input/input_gnome_vfs.c | 2 | ||||
-rw-r--r-- | src/input/input_net.c | 10 | ||||
-rw-r--r-- | src/input/input_pvr.c | 111 | ||||
-rw-r--r-- | src/input/input_v4l.c | 2 | ||||
-rw-r--r-- | src/input/librtsp/rtsp.c | 2 | ||||
-rw-r--r-- | src/input/librtsp/rtsp_session.c | 18 | ||||
-rw-r--r-- | src/input/mms.c | 4 | ||||
-rw-r--r-- | src/input/pnm.c | 4 |
12 files changed, 95 insertions, 86 deletions
diff --git a/src/input/Makefile.am b/src/input/Makefile.am index ddb2b466e..1fc5d1a39 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -119,15 +119,15 @@ xineplug_inp_cdda_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(XDG_BASEDIR_LIBS) $(AVU xineplug_inp_cdda_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) $(AVUTIL_CFLAGS) xineplug_inp_v4l_la_SOURCES = input_v4l.c -xineplug_inp_v4l_la_LIBADD = $(ALSA_LIBS) $(XINE_LIB) $(LTLIBINTL) +xineplug_inp_v4l_la_LIBADD = $(XINE_LIB) $(ALSA_LIBS) $(LTLIBINTL) 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) $(LTLIBINTL) +xineplug_inp_gnome_vfs_la_LIBADD = $(XINE_LIB) $(GNOME_VFS_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) 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) $(LTLIBINTL) +xineplug_inp_smb_la_LIBADD = $(XINE_LIB) $(LIBSMBCLIENT_LIBS) $(LTLIBINTL) xineplug_inp_pvr_la_SOURCES = input_pvr.c xineplug_inp_pvr_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index d266e12c3..d84c442cf 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -989,7 +989,7 @@ static int parse_url (char *urlbuf, char** host, int *port) { #endif static int XINE_FORMAT_PRINTF(4, 5) -network_command( xine_stream_t *stream, int socket, char *data_buf, char *msg, ...) +network_command( xine_stream_t *stream, int socket, void *data_buf, const char *msg, ...) { char buf[_BUFSIZ]; va_list args; @@ -1038,13 +1038,13 @@ network_command( xine_stream_t *stream, int socket, char *data_buf, char *msg, . #ifndef WIN32 -static int network_connect(xine_stream_t *stream, char *url ) +static int network_connect(xine_stream_t *stream, const char *_url ) { char *host; int port; int fd; - url = strdup(url); + char *url = strdup(_url); parse_url(url, &host, &port); if( !host || !strlen(host) || !port ) @@ -1306,8 +1306,6 @@ static void _cdda_mkdir_recursive_safe (xine_t *xine, char *path) if (p) *p = '/'; } while (p); - - return 0; } /* @@ -1632,7 +1630,7 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) { this->cddb.fd = _cdda_cddb_socket_open(this); if(this->cddb.fd >= 0) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - _("input_cdda: successfuly connected to cddb server '%s:%d'.\n"), + _("input_cdda: successfully connected to cddb server '%s:%d'.\n"), this->cddb.server, this->cddb.port); } else { diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 98a60134f..9f53d6b90 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -293,7 +293,7 @@ typedef struct { xine_t *xine; - char *mrls[5]; + const char *mrls[5]; int numchannels; diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 60f58d361..02017956e 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -225,7 +225,7 @@ typedef struct { int32_t region; int32_t play_single_chapter; - char *filelist[MAX_DIR_ENTRIES]; + const char *filelist[MAX_DIR_ENTRIES]; } dvd_input_class_t; @@ -332,7 +332,7 @@ static void send_mouse_enter_leave_event(dvd_input_plugin_t *this, int direction this->mouse_in = !this->mouse_in; if(direction != this->mouse_in) { - const xine_spu_button_t spu_event = { + xine_spu_button_t spu_event = { .direction = direction, .button = this->mouse_buttonN }; @@ -1740,9 +1740,9 @@ static void *init_class (xine_t *xine, void *data) { dvd_input_class_t *this; config_values_t *config = xine->config; void *dvdcss; - static const char *skip_modes[] = {"skip program", "skip part", "skip title", NULL}; - static const char *seek_modes[] = {"seek in program chain", "seek in program", NULL}; - static const char *play_single_chapter_modes[] = {"entire dvd", "one chapter", NULL}; + static const char *const skip_modes[] = {"skip program", "skip part", "skip title", NULL}; + static const char *const seek_modes[] = {"seek in program chain", "seek in program", NULL}; + static const char *const play_single_chapter_modes[] = {"entire dvd", "one chapter", NULL}; trace_print("Called\n"); #ifdef INPUT_DEBUG diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c index 968945023..7fb2d8b00 100644 --- a/src/input/input_gnome_vfs.c +++ b/src/input/input_gnome_vfs.c @@ -200,7 +200,7 @@ gnomevfs_plugin_get_length (input_plugin_t *this_gen) static uint32_t gnomevfs_plugin_get_blocksize (input_plugin_t *this_gen) { - return 32 * 1024; + return 8 * 1024; } static const char* diff --git a/src/input/input_net.c b/src/input/input_net.c index 1d7288f41..8a4874203 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -412,6 +412,8 @@ static int net_plugin_open (input_plugin_t *this_gen ) { char *filename; char *pptr; int port = 7658; + int toread = MAX_PREVIEW_SIZE; + int trycount = 0; filename = this->host_port; pptr=strrchr(filename, ':'); @@ -430,11 +432,15 @@ static int net_plugin_open (input_plugin_t *this_gen ) { /* * fill preview buffer */ + while ((toread > 0) && (trycount < 10)) { #ifndef WIN32 - this->preview_size = read (this->fh, this->preview, MAX_PREVIEW_SIZE); + this->preview_size += read (this->fh, this->preview + this->preview_size, toread); #else - this->preview_size = recv (this->fh, this->preview, MAX_PREVIEW_SIZE, 0); + this->preview_size += recv (this->fh, this->preview + this->preview_size, toread, 0); #endif + trycount++; + toread = MAX_PREVIEW_SIZE - this->preview_size; + } this->curpos = 0; diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index d68b3fe34..50ba4720e 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -979,69 +979,74 @@ static void pvr_event_handler (pvr_input_plugin_t *this) { /* make sure we are not paused */ _x_set_speed(this->stream, XINE_SPEED_NORMAL); - if( v4l2_data->session_id != this->session ) { - /* if session changes -> closes the old one */ - pthread_mutex_lock(&this->lock); - pvr_finish_recording(this); - time(&this->start_time); - this->show_time = this->start_time; - this->session = v4l2_data->session_id; - this->new_session = 1; - this->pvr_play_paused = 0; - this->scr_tunning = 0; - pvrscr_speed_tunning(this->scr, 1.0 ); - pvr_break_rec_page(this); - pthread_mutex_unlock(&this->lock); - _x_demux_flush_engine (this->stream); - } else { - /* no session change, break the page and store a new show_time */ - pthread_mutex_lock(&this->lock); - pvr_break_rec_page(this); - this->show_page = this->rec_page; - pthread_mutex_unlock(&this->lock); - time(&this->show_time); + if ( v4l2_data->session_id != -1) { + if( v4l2_data->session_id != this->session ) { + /* if session changes -> closes the old one */ + pthread_mutex_lock(&this->lock); + pvr_finish_recording(this); + time(&this->start_time); + this->show_time = this->start_time; + this->session = v4l2_data->session_id; + this->new_session = 1; + this->pvr_play_paused = 0; + this->scr_tunning = 0; + pvrscr_speed_tunning(this->scr, 1.0 ); + pvr_break_rec_page(this); + pthread_mutex_unlock(&this->lock); + _x_demux_flush_engine (this->stream); + } else { + /* no session change, break the page and store a new show_time */ + pthread_mutex_lock(&this->lock); + pvr_break_rec_page(this); + this->show_page = this->rec_page; + pthread_mutex_unlock(&this->lock); + time(&this->show_time); + } } - - if( (v4l2_data->input != -1 && v4l2_data->input != this->input) || - (v4l2_data->channel != -1 && v4l2_data->channel != this->channel) || - (v4l2_data->frequency != -1 && v4l2_data->frequency != this->frequency) ) { - struct v4l2_frequency vf; + pthread_mutex_lock(&this->dev_lock); + + /* change input */ + if (v4l2_data->input != -1 && v4l2_data->input != this->input) { + lprintf("change input to:%d\n", v4l2_data->input); this->input = v4l2_data->input; + + /* as of ivtv 0.10.6: must close and reopen to set input */ + close(this->dev_fd); + this->dev_fd = open (this->class->devname, O_RDWR); + if (this->dev_fd == -1) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error opening device %s\n", this->class->devname ); + } else { + if( ioctl(this->dev_fd, VIDIOC_S_INPUT, &this->input) ) + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error setting v4l2 input\n"); + } + } + + /* change channel */ + if (v4l2_data->channel != -1 && v4l2_data->channel != this->channel) { + lprintf("change channel to:%d\n", v4l2_data->channel); this->channel = v4l2_data->channel; - this->frequency = v4l2_data->frequency; + } - lprintf("switching to input:%d chan:%d freq:%.2f\n", - v4l2_data->input, - v4l2_data->channel, - (float)v4l2_data->frequency * 62.5); - - pthread_mutex_lock(&this->dev_lock); - if( ioctl(this->dev_fd, VIDIOC_S_INPUT, &this->input) ) - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error setting v4l2 input\n"); - + /* change frequency */ + if (v4l2_data->frequency != -1 && v4l2_data->frequency != this->frequency) { + lprintf("changing frequency to:%.2f\n", (float)v4l2_data->frequency * 62.5); + struct v4l2_frequency vf; + this->frequency = v4l2_data->frequency; vf.frequency = this->frequency; vf.tuner = 0; if( ioctl(this->dev_fd, VIDIOC_S_FREQUENCY, &vf) ) - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error setting v4l2 frequency\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error setting v4l2 frequency\n"); + } - /* workaround an ivtv bug where stream gets bad mpeg2 artifacts - * after changing inputs. reopening the device fixes it. - */ - close(this->dev_fd); - this->dev_fd = open (this->class->devname, O_RDWR); - if (this->dev_fd == -1) { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error opening device %s\n", this->class->devname ); - return; - } - pthread_mutex_unlock(&this->dev_lock); + pthread_mutex_unlock(&this->dev_lock); - /* FIXME: also flush the device */ - /* _x_demux_flush_engine(this->stream); */ - } + /* FIXME: also flush the device */ + /* _x_demux_flush_engine(this->stream); */ + break; diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 162e2f7ab..28e5b16ce 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -913,7 +913,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this) if (ret < 0) { close (this->video_fd); this->video_fd = -1; - lprintf("Grab: no colorspace format found\n"); + lprintf("Grab: no colour space format found\n"); return 0; } else diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index 7607f2221..cd844654b 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -79,7 +79,7 @@ struct rtsp_s { * constants */ -const char rtsp_protocol_version[]="RTSP/1.0"; +static const char rtsp_protocol_version[]="RTSP/1.0"; /* server states */ #define RTSP_CONNECTED 1 diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c index e9ce5bc5c..5cb0dfb63 100644 --- a/src/input/librtsp/rtsp_session.c +++ b/src/input/librtsp/rtsp_session.c @@ -65,15 +65,15 @@ struct rtsp_session_s { }; /* network bandwidth */ -const uint32_t rtsp_bandwidths[]={14400,19200,28800,33600,34430,57600, - 115200,262200,393216,524300,1544000,10485800}; +static const uint32_t rtsp_bandwidths[]={14400,19200,28800,33600,34430,57600, + 115200,262200,393216,524300,1544000,10485800}; -const char *rtsp_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 rtsp_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}; rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) { @@ -87,7 +87,7 @@ rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) { uint32_t bandwidth; bandwidth_id = xine->config->register_enum(xine->config, "media.network.bandwidth", 10, - (char **)rtsp_bandwidth_strs, + rtsp_bandwidth_strs, _("network bandwidth"), _("Specify the bandwidth of your internet connection here. " "This will be used when streaming servers offer different versions " diff --git a/src/input/mms.c b/src/input/mms.c index 37e7ff395..ba584b4f8 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -601,7 +601,7 @@ static int mms_tcp_connect(mms_t *this) { } static void mms_gen_guid(char guid[]) { - static char digit[16] = "0123456789ABCDEF"; + static const char digit[16] = "0123456789ABCDEF"; int i = 0; srand(time(NULL)); @@ -742,7 +742,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { /* TODO: insert network timing request here */ /* command 0x2 */ lprintf("send command 0x02\n"); - string_utf16 (url_conv, &this->scmd_body[8], "\002\000\\\\192.168.0.129\\TCP\\1037\0000", 28); + string_utf16 (url_conv, &this->scmd_body[8], (ICONV_CONST char*)"\002\000\\\\192.168.0.129\\TCP\\1037\0000", 28); memset (this->scmd_body, 0, 8); if (!send_command (this, 2, 0, 0, 28 * 2 + 8)) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, diff --git a/src/input/pnm.c b/src/input/pnm.c index 3cb36ac3f..564151279 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -92,7 +92,7 @@ struct pnm_s { /* header of rm files */ #define RM_HEADER_SIZE 0x12 -const unsigned char rm_header[]={ +static const unsigned char rm_header[]={ 0x2e, 0x52, 0x4d, 0x46, /* object_id ".RMF" */ 0x00, 0x00, 0x00, 0x12, /* header_size 0x12 */ 0x00, 0x00, /* object_version 0x00 */ @@ -102,7 +102,7 @@ const unsigned char rm_header[]={ /* data chunk header */ #define PNM_DATA_HEADER_SIZE 18 -const unsigned char pnm_data_header[]={ +static const unsigned char pnm_data_header[]={ 'D','A','T','A', 0,0,0,0, /* data chunk size */ 0,0, /* object version */ |