diff options
author | Gerd Knorr <devnull@localhost> | 2004-04-06 15:42:53 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-04-06 15:42:53 +0000 |
commit | cfc412e8739b2ede08491de2d9c79922b4995f3e (patch) | |
tree | 936ce47ee4d3e27543d4c245e403dc32e1a15005 | |
parent | cdb9efa37decdd199e5916aace6e7a1cf4f5ca79 (diff) | |
download | mediapointer-dvb-s2-cfc412e8739b2ede08491de2d9c79922b4995f3e.tar.gz mediapointer-dvb-s2-cfc412e8739b2ede08491de2d9c79922b4995f3e.tar.bz2 |
- add retry loop for carrier scan.
-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]; + } } } |