[filestreamproxy] some bugs fixed.
[vuplus_openvuplus] / meta-openvuplus / recipes-vuplus / tuxtxt / tuxbox-tuxtxt-32bpp / allow_different_demux.diff
1 --- tuxtxt-org/tuxtxt.c 2010-02-10 20:48:39.000000000 +0100
2 +++ tuxtxt/tuxtxt.c     2010-02-10 20:52:39.000000000 +0100
3 @@ -172,6 +172,7 @@
4  {
5         char cvs_revision[] = "$Revision: 1.108 $";
6  
7 +       int demux = 0;
8         int cnt=0;
9         int rc_num = 0;
10  #if !TUXTXT_CFG_STANDALONE
11 @@ -187,18 +188,31 @@
12  
13         tuxtxt_SetRenderingDefaults(&renderinfo);
14         /* get params */
15 -       tuxtxt_cache.vtxtpid = renderinfo.fb = lcd = renderinfo.sx = renderinfo.ex = renderinfo.sy = renderinfo.ey = -1;
16 +       tuxtxt_cache.vtxtpid = 0;
17 +       renderinfo.fb = lcd = renderinfo.sx = renderinfo.ex = renderinfo.sy = renderinfo.ey = -1;
18         if (argc==1)
19         {
20 -               printf("\nUSAGE: tuxtxt vtpid\n");
21 -               printf("No PID given, so scanning for PIDs ...\n\n");
22 -               tuxtxt_cache.vtxtpid=0;
23 +               printf("\nUSAGE: tuxtxt [demux] [vtpid]\n");
24 +               printf("No Demux and PID given, so using demux0 and scanning for PIDs ...\n\n");
25         }
26 -       else 
27 +       else
28         {
29 -               tuxtxt_cache.vtxtpid = atoi(argv[1]);
30 +               demux = atoi(argv[1]);
31 +               if (argc > 2)
32 +                       tuxtxt_cache.vtxtpid = atoi(argv[2]);
33 +               else
34 +               {
35 +                       printf("\nUSAGE: tuxtxt [demux] [vtpid]\n");
36 +                       printf("No PID given, so scanning for PIDs ...\n\n");
37 +               }
38         }
39  
40 +#if HAVE_DVB_API_VERSION < 3
41 +       snprintf(tuxtxt_cache.demux, 64, "/dev/dvb/card0/demux%d", demux);
42 +#else
43 +       snprintf(tuxtxt_cache.demux, 64, "/dev/dvb/adapter0/demux%d", demux);
44 +#endif
45 +
46         /* open Framebuffer */
47         if ((renderinfo.fb=open("/dev/fb/0", O_RDWR)) == -1)
48         {
49 @@ -616,7 +630,7 @@
50         tuxtxt_init_demuxer();
51         tuxtxt_start_thread();
52  #else
53 -       tuxtxt_start(tuxtxt_cache.vtxtpid);
54 +       tuxtxt_start(tuxtxt_cache.vtxtpid, -1);
55  #endif
56  
57  
58 @@ -1821,7 +1835,7 @@
59                                                                 tuxtxt_cache.vtxtpid = pid_table[current_pid].vtxt_pid;
60                                                                 tuxtxt_start_thread();
61  #else
62 -                                                               tuxtxt_start(pid_table[current_pid].vtxt_pid);
63 +                                                               tuxtxt_start(pid_table[current_pid].vtxt_pid, -1);
64  #endif
65                                                         }
66  //                                                     tuxtxt_cache.pageupdate = 1;
67 --- tuxtxt-org/tuxtxt.h 2010-02-10 20:48:39.000000000 +0100
68 +++ tuxtxt/tuxtxt.h     2010-02-10 20:49:07.000000000 +0100
69 @@ -63,7 +63,7 @@
70  extern tstPageAttr tuxtxt_atrtable[];
71  extern int tuxtxt_init();
72  extern void tuxtxt_close();
73 -extern int  tuxtxt_start(int tpid);  // Start caching
74 +extern int  tuxtxt_start(int tpid, int demux);  // Start caching
75  extern int  tuxtxt_stop(); // Stop caching
76  extern void tuxtxt_next_dec(int *i); /* skip to next decimal */
77  extern void tuxtxt_prev_dec(int *i); /* counting down */