diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-12-30 18:37:29 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-12-30 18:37:29 +0000 |
commit | cb2f69533fd5771c386d1b994b2179e76c4ded54 (patch) | |
tree | 98f4f9bff7afd6e9f0ce2c50b01d1e5ad55ec539 /src/input | |
parent | 6dbb05a4cba3cdc811308762058d722f11464683 (diff) | |
parent | aa3d3aacdb991ad989933d71734e300535c7d350 (diff) | |
download | xine-lib-cb2f69533fd5771c386d1b994b2179e76c4ded54.tar.gz xine-lib-cb2f69533fd5771c386d1b994b2179e76c4ded54.tar.bz2 |
Merge from 1.1 (except po/*; translators needed for this).
--HG--
rename : src/video_out/vidix/drivers/mga_vid.c => contrib/vidix/drivers/mga_vid.c
rename : src/video_out/vidix/drivers/nvidia_vid.c => contrib/vidix/drivers/nvidia_vid.c
rename : src/video_out/vidix/drivers/savage_vid.c => contrib/vidix/drivers/savage_vid.c
rename : src/xine-engine/video_out.h => include/xine/video_out.h
rename : src/xine-utils/xmllexer.h => include/xine/xmllexer.h
rename : po/libxine1.pot => po/libxine2.pot
rename : src/libsputext/xine_sputext_decoder.c => src/spu_dec/sputext_decoder.c
rename : src/libsputext/demux_sputext.c => src/spu_dec/sputext_demuxer.c
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/input_cdda.c | 2 | ||||
-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 |
4 files changed, 68 insertions, 57 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index c08e1ca0b..3cad27bbe 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1630,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_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; |