From: Miguel F. <mig...@us...> - 2004-10-27 22:39:57
|
Update of /cvsroot/xine/xine-lib/src/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10052/src/input Modified Files: input_v4l.c Log Message: barry scott v4l patch Index: input_v4l.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/input_v4l.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- input_v4l.c 20 Sep 2004 19:30:04 -0000 1.47 +++ input_v4l.c 27 Oct 2004 22:39:48 -0000 1.48 @@ -626,6 +626,8 @@ 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 @@ 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 @@ 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) { |