From 848f806c696246abae325d2bf33fea182b93b51e Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Wed, 27 Oct 2004 22:39:48 +0000 Subject: barry scott v4l patch CVS patchset: 7082 CVS date: 2004/10/27 22:39:48 --- AUTHORS | 3 +++ src/input/input_v4l.c | 22 ++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/AUTHORS b/AUTHORS index 513d2e828..7b078bca8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -513,5 +513,8 @@ Frank van Viegen Sylvain Colinet mpl2 subtitle support + +Barry Scott + fix V4l source selection code by MRL (let us know if we've forgotten anyone) diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index b1d42bd82..73a765598 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -626,6 +626,8 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source) int ret = 0; int fd = 0; + lprintf("input_source: %s\n", input_source); + this->input = 0; if (this->video_fd > 0) @@ -634,18 +636,10 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source) fd = this->radio_fd; /* Tune into channel */ - ret = ioctl(fd, VIDIOCGCHAN, &this->video_channel); - lprintf("(%d) V4L device currently set to:\n", ret); - lprintf("Channel: %d\n", this->video_channel.channel); - lprintf("Name: %s\n", this->video_channel.name); - lprintf("Tuners: %d\n", this->video_channel.tuners); - lprintf("Flags: %d\n", this->video_channel.flags); - lprintf("Type: %d\n", this->video_channel.type); - lprintf("Norm: %d\n", this->video_channel.norm); - if (strlen(input_source) > 0) { - while (strstr(this->video_channel.name, input_source) == NULL && - ioctl(fd, VIDIOCGCHAN, &this->video_channel) == 0) { + for( this->video_channel.channel = 0; + ioctl(fd, VIDIOCGCHAN, &this->video_channel) == 0; + this->video_channel.channel++ ) { lprintf("V4L device currently set to:\n"); lprintf("Channel: %d\n", this->video_channel.channel); @@ -654,7 +648,11 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source) lprintf("Flags: %d\n", this->video_channel.flags); lprintf("Type: %d\n", this->video_channel.type); lprintf("Norm: %d\n", this->video_channel.norm); - this->video_channel.channel = ++this->input; + + if (strstr(this->video_channel.name, input_source) != NULL) { + this->input = this->video_channel.channel; + break; + } } if (strstr(this->video_channel.name, input_source) == NULL) { -- cgit v1.2.3