summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-27 22:39:48 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-27 22:39:48 +0000
commit848f806c696246abae325d2bf33fea182b93b51e (patch)
treeb1b486833f44ad44692d6170add14083cfd48032
parent5ebd960784f10fa5781449e2c57bd5798cb00f03 (diff)
downloadxine-lib-848f806c696246abae325d2bf33fea182b93b51e.tar.gz
xine-lib-848f806c696246abae325d2bf33fea182b93b51e.tar.bz2
barry scott v4l patch
CVS patchset: 7082 CVS date: 2004/10/27 22:39:48
-rw-r--r--AUTHORS3
-rw-r--r--src/input/input_v4l.c22
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 <frank@vanviegen.net>
Sylvain Colinet <scolinet@gmail.com>
mpl2 subtitle support
+
+Barry Scott <barry.scott@onelan.co.uk>
+ 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) {