]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
EN50494: merge mutex_unlocks after for-loop
authorSascha Kuehndel (InuSasha) <dev@inusasha.de>
Thu, 9 Jan 2014 19:01:51 +0000 (20:01 +0100)
committerSascha Kuehndel (InuSasha) <dev@inusasha.de>
Thu, 9 Jan 2014 19:01:51 +0000 (20:01 +0100)
src/input/mpegts/linuxdvb/linuxdvb_en50494.c

index 16f1e0f0a09e19a9c8607d45fcbded6c20089f91..e2ca8678e0b825aff347831252ce85c45841fb6e 100644 (file)
@@ -166,10 +166,10 @@ linuxdvb_en50494_tune
     }
 
     /* use 18V */
-    if (linuxdvb_diseqc_set_volt(fd, SEC_VOLTAGE_18)) {
+    ret = linuxdvb_diseqc_set_volt(fd, SEC_VOLTAGE_18);
+    if (ret) {
       tvherror(LINUXDVB_EN50494_NAME, "error setting lnb voltage to 18V");
-      pthread_mutex_unlock(&linuxdvb_en50494_lock);
-      return -1;
+      break;
     }
     usleep(15000); /* standard: 4ms < x < 22ms */
 
@@ -191,21 +191,20 @@ linuxdvb_en50494_tune
     }
     if (ret != 0) {
       tvherror(LINUXDVB_EN50494_NAME, "error send tune command");
-      pthread_mutex_unlock(&linuxdvb_en50494_lock);
-      return -1;
+      break;
     }
     usleep(50000); /* standard: 2ms < x < 60ms */
 
     /* return to 13V */
-    if (linuxdvb_diseqc_set_volt(fd, SEC_VOLTAGE_13)) {
+    ret = linuxdvb_diseqc_set_volt(fd, SEC_VOLTAGE_13);
+    if (ret) {
       tvherror(LINUXDVB_EN50494_NAME, "error setting lnb voltage back to 13V");
-      pthread_mutex_unlock(&linuxdvb_en50494_lock);
-      return -1;
+      break;
     }
   }
   pthread_mutex_unlock(&linuxdvb_en50494_lock);
 
-  return 0;
+  return ret == 0 ? 0 : -1;
 }