diff options
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index b55843ec0..cdd35478b 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -468,7 +468,7 @@ static int tvaudio_thread(void *data) struct saa7134_dev *dev = data; const int *carr_scan; int carr_vals[4]; - unsigned int i, audio; + unsigned int i, audio, retries; int max1,max2,carrier,rx,mode,lastmode; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61) @@ -508,22 +508,26 @@ static int tvaudio_thread(void *data) carr_scan = carr_secam; saa_writeb(SAA7134_MONITOR_SELECT,0x00); tvaudio_setmode(dev,&tvaudio[0],NULL); - for (i = 0; i < MAX_SCAN; i++) { - if (!carr_scan[i]) - continue; - carr_vals[i] = tvaudio_checkcarrier(dev,carr_scan[i]); - if (dev->thread.scan1 != dev->thread.scan2) - goto restart; - } - for (carrier = 0, max1 = 0, max2 = 0, i = 0; i < MAX_SCAN; i++) { - if (!carr_scan[i]) - continue; - if (max1 < carr_vals[i]) { - max2 = max1; - max1 = carr_vals[i]; - carrier = carr_scan[i]; - } else if (max2 < carr_vals[i]) { - max2 = carr_vals[i]; + + carrier = 0; + for (retries = 3; retries > 0 && 0 == carrier; retries--) { + for (i = 0; i < MAX_SCAN; i++) { + if (!carr_scan[i]) + continue; + carr_vals[i] = tvaudio_checkcarrier(dev,carr_scan[i]); + if (dev->thread.scan1 != dev->thread.scan2) + goto restart; + } + for (max1 = 0, max2 = 0, i = 0; i < MAX_SCAN; i++) { + if (!carr_scan[i]) + continue; + if (max1 < carr_vals[i]) { + max2 = max1; + max1 = carr_vals[i]; + carrier = carr_scan[i]; + } else if (max2 < carr_vals[i]) { + max2 = carr_vals[i]; + } } } |