Merge remote-tracking branch 'oe_21/master' into vuplus-3.0
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / usbtunerhelper / usbtunerhelper / fix_set_delsys.patch
1 diff --git a/usbtunerhelper.c b/usbtunerhelper.c
2 index 93ae110..77b8728 100644
3 --- a/usbtunerhelper.c
4 +++ b/usbtunerhelper.c
5 @@ -533,7 +533,6 @@ int init_adapter(int id)
6         ioctl(adapter->vtuner, VTUNER_SET_NAME, adapter->name);
7         ioctl(adapter->vtuner, VTUNER_SET_TYPE, type);
8         ioctl(adapter->vtuner, VTUNER_SET_FE_INFO, &fe_info);
9 -       ioctl(adapter->vtuner, VTUNER_SET_HAS_OUTPUTS, "no");
10  #if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 5
11         {
12                 struct dtv_properties props;
13 @@ -541,12 +540,14 @@ int init_adapter(int id)
14                 props.num = 1;
15                 props.props = p;
16                 p[0].cmd = DTV_ENUM_DELSYS;
17 +               memset(p[0].u.buffer.data, 0, sizeof(p[0].u.buffer.data));
18                 if (ioctl(adapter->frontend, FE_GET_PROPERTY, &props) >= 0)
19                 {
20                         ioctl(adapter->vtuner, VTUNER_SET_DELSYS, p[0].u.buffer.data);
21                 }
22         }
23  #endif
24 +       ioctl(adapter->vtuner, VTUNER_SET_HAS_OUTPUTS, "no");
25  
26         memset(adapter->pidlist, 0xff, sizeof(adapter->pidlist));
27         adapter->buffer = malloc(BUFFER_SIZE);
28 @@ -599,6 +600,8 @@ int main(int argc, char *argv[])
29         int i;
30         int ok = 0;
31         int debug = 0;
32 +       int scan_inverval = 1;
33 +       int scan_count = 60;
34  
35         char option;
36         while ((option = getopt(argc, argv, "dh")) >= 0)
37 @@ -621,8 +624,15 @@ int main(int argc, char *argv[])
38  
39         while (running)
40         {
41 -               if (scan_adapters() > 0) break;
42 -               sleep(5);
43 +               if (scan_adapters() > 0)
44 +                       break;
45 +
46 +               if (scan_count > 0)
47 +                       scan_count--;
48 +               else
49 +                       scan_inverval = 5;
50 +
51 +               sleep(scan_inverval);
52         }
53  
54         for (i = 0; i < adaptercount; i++)