This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/xawtv3.git tree:

Subject: Fix a few backport issues on radio
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Fri Jan 28 20:24:46 2011 -0200

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 console/radio.c |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

---

http://git.linuxtv.org/xawtv3.git?a=commitdiff;h=d2073b8f9771995ed80984c0342be3c7e5f7afef

diff --git a/console/radio.c b/console/radio.c
index 616b43d..aa4cbdc 100644
--- a/console/radio.c
+++ b/console/radio.c
@@ -56,20 +56,21 @@ radio_setfreq(int fd, float freq)
     memset (&frequency, 0, sizeof(frequency));
     frequency.type = V4L2_TUNER_RADIO;
     frequency.frequency = ifreq;
-    return ioctl(fd, VIDIOC_S_FREQUENCY, &frequency);
+    return (ioctl(fd, VIDIOC_S_FREQUENCY, &frequency) == -1);
 }
 
 static int radio_getfreq(int fd, float *freq)
 {
-    int ioctl_status;
     int ifreq;
     struct v4l2_frequency frequency;
 
     memset (&frequency, 0, sizeof(frequency));
+    frequency.type = V4L2_TUNER_RADIO;
 
-    ioctl_status = ioctl(fd, VIDIOC_G_FREQUENCY, &frequency);
-    if (ioctl_status == -1)
-        return ioctl_status;
+    if (-1  == ioctl(fd, VIDIOC_G_FREQUENCY, &frequency)) {
+       perror("VIDIOC_G_FREQUENCY");
+        return errno;
+    }
 
     ifreq = frequency.frequency;
     *freq = (float) ifreq / freqfact;
@@ -85,7 +86,7 @@ radio_mute(int fd, int mute)
     ctrl.id = V4L2_CID_AUDIO_MUTE;
     ctrl.value = mute;
 
-    if (ioctl(fd, VIDIOC_S_CTRL, &ctrl));
+    if (ioctl(fd, VIDIOC_S_CTRL, &ctrl) == -1)
        perror("VIDIOC_S_CTRL");
 }
 
@@ -98,8 +99,7 @@ radio_getstereo(int fd)
        return;
 
     memset (&tuner, 0, sizeof(tuner));
-    
-    if (ioctl (fd, VIDIOC_G_TUNER, tuner)) {
+    if (ioctl (fd, VIDIOC_G_TUNER, &tuner) == -1) {
        mvwprintw(wfreq,2,1,"     ");
        perror("VIDIOC_G_TUNER");
        return;
@@ -116,8 +116,7 @@ radio_getsignal(int fd)
     int signal, i;
 
     memset (&tuner, 0, sizeof(tuner));
-    
-    if (ioctl (fd, VIDIOC_G_TUNER, tuner)) {
+    if (ioctl (fd, VIDIOC_G_TUNER, &tuner) == -1) {
        perror("VIDIOC_G_TUNER");
        return 0;
     }
@@ -461,8 +460,8 @@ main(int argc, char *argv[])
        exit(1);
     }
 
-    memset(&tuner,0,sizeof(tuner));
-    if (0 == ioctl(fd, VIDIOC_G_TUNER, &tuner) &&
+    memset(&tuner, 0, sizeof(tuner));
+    if ((-1 != ioctl(fd, VIDIOC_G_TUNER, &tuner)) &&
        (tuner.capability & V4L2_TUNER_CAP_LOW))
        freqfact = 16000;
 
@@ -552,10 +551,10 @@ main(int argc, char *argv[])
        mvwprintw(wstations,1,1,"[none]");
     wrefresh(wstations);
 
-    if (ifreq == 0) {
-       float ffreq;
-       radio_getfreq(fd,&ffreq);
-       ifreq = ffreq * 1000000;
+    if (!ifreq) {
+       float ffreq = 0;
+       if (!radio_getfreq(fd,&ffreq))
+               ifreq = ffreq * 1000000;
     }
     
     radio_mute(fd, 0);

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to