Mercurial > mplayer.hg
annotate stream/dvb_tune.c @ 31545:4500ce87a70c
Give functions proper prototypes.
author | reimar |
---|---|
date | Thu, 01 Jul 2010 21:11:10 +0000 |
parents | d9bbd1844876 |
children |
rev | line source |
---|---|
9610 | 1 /* dvbtune - tune.c |
2 | |
3 Copyright (C) Dave Chapman 2001,2002 | |
4 | |
18783 | 5 Modified for use with MPlayer, for details see the changelog at |
6 http://svn.mplayerhq.hu/mplayer/trunk/ | |
15178
8dd7a656eaf8
Mark modified imported files as such to comply more closely with GPL ¡ø2a.
diego
parents:
14382
diff
changeset
|
7 $Id$ |
8dd7a656eaf8
Mark modified imported files as such to comply more closely with GPL ¡ø2a.
diego
parents:
14382
diff
changeset
|
8 |
9610 | 9 This program is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU General Public License | |
11 as published by the Free Software Foundation; either version 2 | |
12 of the License, or (at your option) any later version. | |
13 | |
14 This program is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
20 along with this program; if not, write to the Free Software | |
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 Or, point your browser to http://www.gnu.org/copyleft/gpl.html | |
23 | |
24 */ | |
25 | |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <ctype.h> | |
29 #include <sys/ioctl.h> | |
27431
bb738b9ea7c4
Use '#include <poll.h>' instead of '#include <sys/poll.h>'.
diego
parents:
27370
diff
changeset
|
30 #include <poll.h> |
9610 | 31 #include <unistd.h> |
32 #include <fcntl.h> | |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
33 #include <time.h> |
10560 | 34 #include <errno.h> |
30776 | 35 #include <linux/dvb/dmx.h> |
36 #include <linux/dvb/frontend.h> | |
9610 | 37 #include "config.h" |
38 #include "dvbin.h" | |
30646 | 39 #include "dvb_tune.h" |
17012 | 40 #include "mp_msg.h" |
9610 | 41 |
42 | |
43 | |
12309 | 44 int dvb_get_tuner_type(int fe_fd) |
9610 | 45 { |
10560 | 46 struct dvb_frontend_info fe_info; |
47 | |
12309 | 48 int res; |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
49 |
10560 | 50 res = ioctl(fe_fd, FE_GET_INFO, &fe_info); |
51 if(res < 0) | |
52 { | |
53 mp_msg(MSGT_DEMUX, MSGL_ERR, "FE_GET_INFO error: %d, FD: %d\n\n", errno, fe_fd); | |
54 return 0; | |
55 } | |
56 | |
57 switch(fe_info.type) | |
58 { | |
59 case FE_OFDM: | |
12309 | 60 mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-T\n"); |
10560 | 61 return TUNER_TER; |
62 | |
63 case FE_QPSK: | |
12309 | 64 mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-S\n"); |
10560 | 65 return TUNER_SAT; |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
66 |
10560 | 67 case FE_QAM: |
12309 | 68 mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-C\n"); |
10560 | 69 return TUNER_CBL; |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
70 |
14382 | 71 #ifdef DVB_ATSC |
72 case FE_ATSC: | |
73 mp_msg(MSGT_DEMUX, MSGL_V, "TUNER TYPE SEEMS TO BE DVB-ATSC\n"); | |
74 return TUNER_ATSC; | |
75 #endif | |
10560 | 76 default: |
77 mp_msg(MSGT_DEMUX, MSGL_ERR, "UNKNOWN TUNER TYPE\n"); | |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
78 return 0; |
10560 | 79 } |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
80 |
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
81 } |
10560 | 82 |
24875 | 83 int dvb_open_devices(dvb_priv_t *priv, int n, int demux_cnt) |
10560 | 84 { |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
85 int i; |
27786
187ca29cd878
Conditionally declare a conditionally used variable, fixes the warning:
diego
parents:
27431
diff
changeset
|
86 char frontend_dev[32], dvr_dev[32], demux_dev[32]; |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
87 |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
88 sprintf(frontend_dev, "/dev/dvb/adapter%d/frontend0", n); |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
89 sprintf(dvr_dev, "/dev/dvb/adapter%d/dvr0", n); |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
90 sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", n); |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
91 priv->fe_fd = open(frontend_dev, O_RDWR | O_NONBLOCK); |
10560 | 92 if(priv->fe_fd < 0) |
9610 | 93 { |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
94 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING FRONTEND DEVICE %s: ERRNO %d\n", frontend_dev, errno); |
10560 | 95 return 0; |
9610 | 96 } |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
97 priv->demux_fds_cnt = 0; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
98 mp_msg(MSGT_DEMUX, MSGL_V, "DVB_OPEN_DEVICES(%d)\n", demux_cnt); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
99 for(i = 0; i < demux_cnt; i++) |
12309 | 100 { |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
101 priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK); |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
102 if(priv->demux_fds[i] < 0) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
103 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
104 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DEMUX 0: %d\n", errno); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
105 return 0; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
106 } |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
107 else |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
108 { |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
109 mp_msg(MSGT_DEMUX, MSGL_V, "OPEN(%d), file %s: FD=%d, CNT=%d\n", i, demux_dev, priv->demux_fds[i], priv->demux_fds_cnt); |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
110 priv->demux_fds_cnt++; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
111 } |
12309 | 112 } |
113 | |
114 | |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
115 priv->dvr_fd = open(dvr_dev, O_RDONLY| O_NONBLOCK); |
12309 | 116 if(priv->dvr_fd < 0) |
117 { | |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
118 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DVR DEVICE %s: %d\n", dvr_dev, errno); |
12309 | 119 return 0; |
120 } | |
10560 | 121 |
21777 | 122 return 1; |
9610 | 123 } |
124 | |
125 | |
24875 | 126 int dvb_fix_demuxes(dvb_priv_t *priv, int cnt) |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
127 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
128 int i; |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
129 char demux_dev[32]; |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
130 |
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
131 sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", priv->card); |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
132 mp_msg(MSGT_DEMUX, MSGL_V, "FIX %d -> %d\n", priv->demux_fds_cnt, cnt); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
133 if(priv->demux_fds_cnt >= cnt) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
134 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
135 for(i = priv->demux_fds_cnt-1; i >= cnt; i--) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
136 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
137 mp_msg(MSGT_DEMUX, MSGL_V, "FIX, CLOSE fd(%d): %d\n", i, priv->demux_fds[i]); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
138 close(priv->demux_fds[i]); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
139 } |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
140 priv->demux_fds_cnt = cnt; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
141 } |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
142 else if(priv->demux_fds_cnt < cnt) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
143 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
144 for(i = priv->demux_fds_cnt; i < cnt; i++) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
145 { |
26401
617754f47828
in preparation for multi-frontend patch replaced file-static device names with sprintf() calls in 2 functions
nicodvb
parents:
25694
diff
changeset
|
146 priv->demux_fds[i] = open(demux_dev, O_RDWR | O_NONBLOCK); |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
147 mp_msg(MSGT_DEMUX, MSGL_V, "FIX, OPEN fd(%d): %d\n", i, priv->demux_fds[i]); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
148 if(priv->demux_fds[i] < 0) |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
149 { |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
150 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING DEMUX 0: %d\n", errno); |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
151 return 0; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
152 } |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
153 else |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
154 priv->demux_fds_cnt++; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27863
diff
changeset
|
155 } |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
156 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27863
diff
changeset
|
157 |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
158 return 1; |
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
159 } |
9610 | 160 |
10560 | 161 int dvb_set_ts_filt(int fd, uint16_t pid, dmx_pes_type_t pestype) |
9610 | 162 { |
163 int i; | |
164 struct dmx_pes_filter_params pesFilterParams; | |
165 | |
166 pesFilterParams.pid = pid; | |
167 pesFilterParams.input = DMX_IN_FRONTEND; | |
168 pesFilterParams.output = DMX_OUT_TS_TAP; | |
169 pesFilterParams.pes_type = pestype; | |
10560 | 170 pesFilterParams.flags = DMX_IMMEDIATE_START; |
9610 | 171 |
12803
168238f8c715
added multi-pid parsing code (up to 15), pid 0 is always added (for the PAT)
nicodvb
parents:
12309
diff
changeset
|
172 errno = 0; |
9610 | 173 if ((i = ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams)) < 0) |
174 { | |
10560 | 175 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR IN SETTING DMX_FILTER %i for fd %d: ERRNO: %d", pid, fd, errno); |
176 return 0; | |
9610 | 177 } |
178 | |
10560 | 179 mp_msg(MSGT_DEMUX, MSGL_V, "SET PES FILTER ON PID %d to fd %d, RESULT: %d, ERRNO: %d\n", pid, fd, i, errno); |
9610 | 180 return 1; |
181 } | |
182 | |
183 | |
10560 | 184 int dvb_demux_stop(int fd) |
9610 | 185 { |
186 int i; | |
187 i = ioctl(fd, DMX_STOP); | |
188 | |
189 mp_msg(MSGT_DEMUX, MSGL_DBG2, "STOPPING FD: %d, RESULT: %d\n", fd, i); | |
190 | |
29717
afc8b80eb027
cosmetics: Remove some pointless parentheses from return calls.
diego
parents:
29263
diff
changeset
|
191 return i == 0; |
9610 | 192 } |
193 | |
194 | |
10560 | 195 int dvb_demux_start(int fd) |
196 { | |
197 int i; | |
198 i = ioctl(fd, DMX_START); | |
9610 | 199 |
10560 | 200 mp_msg(MSGT_DEMUX, MSGL_DBG2, "STARTING FD: %d, RESULT: %d\n", fd, i); |
201 | |
29717
afc8b80eb027
cosmetics: Remove some pointless parentheses from return calls.
diego
parents:
29263
diff
changeset
|
202 return i == 0; |
10560 | 203 } |
204 | |
205 | |
9610 | 206 static void print_status(fe_status_t festatus) |
207 { | |
208 mp_msg(MSGT_DEMUX, MSGL_V, "FE_STATUS:"); | |
209 if (festatus & FE_HAS_SIGNAL) mp_msg(MSGT_DEMUX, MSGL_V," FE_HAS_SIGNAL"); | |
210 if (festatus & FE_TIMEDOUT) mp_msg(MSGT_DEMUX, MSGL_V, " FE_TIMEDOUT"); | |
211 if (festatus & FE_HAS_LOCK) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_LOCK"); | |
212 if (festatus & FE_HAS_CARRIER) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_CARRIER"); | |
213 if (festatus & FE_HAS_VITERBI) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_VITERBI"); | |
214 if (festatus & FE_HAS_SYNC) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_SYNC"); | |
215 mp_msg(MSGT_DEMUX, MSGL_V, "\n"); | |
216 } | |
217 | |
218 | |
21816 | 219 static int check_status(int fd_frontend, int tmout) |
9610 | 220 { |
221 int32_t strength; | |
222 fe_status_t festatus; | |
223 struct pollfd pfd[1]; | |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
224 int ok=0, locks=0; |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
225 time_t tm1, tm2; |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
226 |
9610 | 227 pfd[0].fd = fd_frontend; |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
228 pfd[0].events = POLLPRI; |
9610 | 229 |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
230 mp_msg(MSGT_DEMUX, MSGL_V, "Getting frontend status\n"); |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
231 tm1 = tm2 = time((time_t*) NULL); |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
232 while(!ok) |
9610 | 233 { |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
234 festatus = 0; |
18561 | 235 if(poll(pfd,1,tmout*1000) > 0) |
9610 | 236 { |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
237 if (pfd[0].revents & POLLPRI) |
9610 | 238 { |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
239 if(ioctl(fd_frontend, FE_READ_STATUS, &festatus) >= 0) |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
240 if(festatus & FE_HAS_LOCK) |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
241 locks++; |
9610 | 242 } |
243 } | |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
244 usleep(10000); |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
245 tm2 = time((time_t*) NULL); |
18561 | 246 if((festatus & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= tmout)) |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
247 ok = 1; |
9610 | 248 } |
249 | |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
250 if(festatus & FE_HAS_LOCK) |
9610 | 251 { |
252 strength=0; | |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
253 if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0) |
9610 | 254 mp_msg(MSGT_DEMUX, MSGL_V, "Bit error rate: %d\n",strength); |
255 | |
256 strength=0; | |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
257 if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0) |
9610 | 258 mp_msg(MSGT_DEMUX, MSGL_V, "Signal strength: %d\n",strength); |
259 | |
260 strength=0; | |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
261 if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0) |
9610 | 262 mp_msg(MSGT_DEMUX, MSGL_V, "SNR: %d\n",strength); |
263 | |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
264 strength=0; |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
265 if(ioctl(fd_frontend,FE_READ_UNCORRECTED_BLOCKS,&strength) >= 0) |
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
266 mp_msg(MSGT_DEMUX, MSGL_V, "UNC: %d\n",strength); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27863
diff
changeset
|
267 |
9610 | 268 print_status(festatus); |
269 } | |
270 else | |
271 { | |
18561 | 272 mp_msg(MSGT_DEMUX, MSGL_ERR, "Not able to lock to the signal on the given frequency, timeout: %d\n", tmout); |
9610 | 273 return -1; |
274 } | |
275 return 0; | |
276 } | |
277 | |
30645
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
278 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
279 struct diseqc_cmd { |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
280 struct dvb_diseqc_master_cmd cmd; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
281 uint32_t wait; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
282 }; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
283 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
284 static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
285 fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
286 { |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
287 if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
288 return -1; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
289 if(ioctl(fd, FE_SET_VOLTAGE, v) == -1) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
290 return -1; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
291 usleep(15 * 1000); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
292 if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) == -1) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
293 return -1; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
294 usleep(cmd->wait * 1000); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
295 usleep(15 * 1000); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
296 if(ioctl(fd, FE_DISEQC_SEND_BURST, b) == -1) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
297 return -1; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
298 usleep(15 * 1000); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
299 if(ioctl(fd, FE_SET_TONE, t) == -1) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
300 return -1; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
301 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
302 return 0; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
303 } |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
304 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
305 /* digital satellite equipment control, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
306 * specification is available from http://www.eutelsat.com/ |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
307 */ |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
308 static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
309 { |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
310 struct diseqc_cmd cmd = { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 }; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
311 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
312 /* param: high nibble: reset bits, low nibble set bits, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
313 * bits are: option, position, polarizaion, band |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
314 */ |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
315 cmd.cmd.msg[3] = |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
316 0xf0 | (((sat_no * 4) & 0x0f) | (hi_lo ? 1 : 0) | (polv ? 0 : 2)); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
317 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
318 return diseqc_send_msg(secfd, polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
319 &cmd, hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
320 (sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
321 } |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
322 |
9610 | 323 static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone, |
324 fe_spectral_inversion_t specInv, unsigned int diseqc, fe_modulation_t modulation, fe_code_rate_t HP_CodeRate, | |
13155
fd40ef23053b
added forgotten dvb-t params lp_coderate and hierarchy
nicodvb
parents:
12803
diff
changeset
|
325 fe_transmit_mode_t TransmissionMode, fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth, |
18561 | 326 fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout) |
9610 | 327 { |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
328 int res, hi_lo, dfd; |
9610 | 329 struct dvb_frontend_parameters feparams; |
330 struct dvb_frontend_info fe_info; | |
331 | |
10560 | 332 mp_msg(MSGT_DEMUX, MSGL_V, "TUNE_IT, fd_frontend %d, fd_sec %d\nfreq %lu, srate %lu, pol %c, tone %i, specInv, diseqc %u, fe_modulation_t modulation,fe_code_rate_t HP_CodeRate, fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth\n", |
21825 | 333 fd_frontend, fd_sec, (long unsigned int)freq, (long unsigned int)srate, pol, tone, diseqc); |
9610 | 334 |
335 | |
21824 | 336 memset(&feparams, 0, sizeof(feparams)); |
9610 | 337 if ( (res = ioctl(fd_frontend,FE_GET_INFO, &fe_info) < 0)) |
338 { | |
21825 | 339 mp_msg(MSGT_DEMUX, MSGL_FATAL, "FE_GET_INFO FAILED\n"); |
340 return -1; | |
9610 | 341 } |
342 | |
10560 | 343 mp_msg(MSGT_DEMUX, MSGL_V, "Using DVB card \"%s\"\n", fe_info.name); |
9610 | 344 |
345 switch(fe_info.type) | |
346 { | |
347 case FE_OFDM: | |
348 if (freq < 1000000) freq*=1000UL; | |
349 feparams.frequency=freq; | |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
350 feparams.inversion=specInv; |
9610 | 351 feparams.u.ofdm.bandwidth=bandwidth; |
352 feparams.u.ofdm.code_rate_HP=HP_CodeRate; | |
13155
fd40ef23053b
added forgotten dvb-t params lp_coderate and hierarchy
nicodvb
parents:
12803
diff
changeset
|
353 feparams.u.ofdm.code_rate_LP=LP_CodeRate; |
9610 | 354 feparams.u.ofdm.constellation=modulation; |
355 feparams.u.ofdm.transmission_mode=TransmissionMode; | |
356 feparams.u.ofdm.guard_interval=guardInterval; | |
13155
fd40ef23053b
added forgotten dvb-t params lp_coderate and hierarchy
nicodvb
parents:
12803
diff
changeset
|
357 feparams.u.ofdm.hierarchy_information=hier; |
14282
2188637c0e8f
replaced deprecated FE_GET_EVENT with FE_READ_STATUS (only for DVB_HEAD); added a workaround for drivers that don't support FE_TIMEDOUT
nicodvb
parents:
13155
diff
changeset
|
358 mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-T to %d Hz, bandwidth: %d\n",freq, bandwidth); |
9610 | 359 break; |
360 case FE_QPSK: | |
361 if (freq > 2200000) | |
362 { | |
363 // this must be an absolute frequency | |
364 if (freq < SLOF) | |
21825 | 365 { |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
366 freq = feparams.frequency=(freq-LOF1); |
21825 | 367 hi_lo = 0; |
9610 | 368 } |
21825 | 369 else |
370 { | |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
371 freq = feparams.frequency=(freq-LOF2); |
21825 | 372 hi_lo = 1; |
9610 | 373 } |
374 } | |
375 else | |
376 { | |
377 // this is an L-Band frequency | |
378 feparams.frequency=freq; | |
379 } | |
380 | |
381 feparams.inversion=specInv; | |
382 feparams.u.qpsk.symbol_rate=srate; | |
12048
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
383 feparams.u.qpsk.fec_inner=HP_CodeRate; |
09aae06de9c8
removed unused code, synced to szap tuning sequence and unified diseqc, tone and voltage in a (non/old)-diseqc compatible function
nicodvb
parents:
11872
diff
changeset
|
384 dfd = fd_frontend; |
9610 | 385 |
21825 | 386 mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-S to Freq: %u, Pol: %c Srate: %d, 22kHz: %s, LNB: %d\n",freq,pol,srate,hi_lo ? "on" : "off", diseqc); |
9610 | 387 |
21825 | 388 if(do_diseqc(dfd, diseqc, (pol == 'V' ? 1 : 0), hi_lo) == 0) |
389 mp_msg(MSGT_DEMUX, MSGL_V, "DISEQC SETTING SUCCEDED\n"); | |
390 else | |
391 { | |
392 mp_msg(MSGT_DEMUX, MSGL_ERR, "DISEQC SETTING FAILED\n"); | |
393 return -1; | |
394 } | |
9610 | 395 break; |
396 case FE_QAM: | |
397 mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-C to %d, srate=%d\n",freq,srate); | |
398 feparams.frequency=freq; | |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
399 feparams.inversion=specInv; |
9610 | 400 feparams.u.qam.symbol_rate = srate; |
11872
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
401 feparams.u.qam.fec_inner = HP_CodeRate; |
d158978a3d3c
Compliance with the DVB power management specification (doesn't close
attila
parents:
11352
diff
changeset
|
402 feparams.u.qam.modulation = modulation; |
9610 | 403 break; |
14382 | 404 #ifdef DVB_ATSC |
405 case FE_ATSC: | |
406 mp_msg(MSGT_DEMUX, MSGL_V, "tuning ATSC to %d, modulation=%d\n",freq,modulation); | |
407 feparams.frequency=freq; | |
408 feparams.u.vsb.modulation = modulation; | |
409 break; | |
410 #endif | |
9610 | 411 default: |
412 mp_msg(MSGT_DEMUX, MSGL_V, "Unknown FE type. Aborting\n"); | |
10603 | 413 return 0; |
9610 | 414 } |
415 usleep(100000); | |
416 | |
21815
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
417 if(ioctl(fd_frontend,FE_SET_FRONTEND,&feparams) < 0) |
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
418 { |
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
419 mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n"); |
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
420 return -1; |
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
421 } |
8b2d611f3ade
moved actual tuning code from check_status() to tune_it()
nicodvb
parents:
21777
diff
changeset
|
422 |
29717
afc8b80eb027
cosmetics: Remove some pointless parentheses from return calls.
diego
parents:
29263
diff
changeset
|
423 return check_status(fd_frontend, timeout); |
9610 | 424 } |
30645
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
425 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
426 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
427 int dvb_tune(dvb_priv_t *priv, int freq, char pol, int srate, int diseqc, int tone, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
428 fe_spectral_inversion_t specInv, fe_modulation_t modulation, fe_guard_interval_t guardInterval, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
429 fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_code_rate_t HP_CodeRate, |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
430 fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
431 { |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
432 int ris; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
433 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
434 mp_msg(MSGT_DEMUX, MSGL_INFO, "dvb_tune Freq: %lu\n", (long unsigned int) freq); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
435 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
436 ris = tune_it(priv->fe_fd, priv->sec_fd, freq, srate, pol, tone, specInv, diseqc, modulation, HP_CodeRate, TransmissionMode, guardInterval, bandWidth, LP_CodeRate, hier, timeout); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
437 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
438 if(ris != 0) |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
439 mp_msg(MSGT_DEMUX, MSGL_INFO, "dvb_tune, TUNING FAILED\n"); |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
440 |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
441 return ris == 0; |
7a5b8fc5df4a
cosmetics: Move functions around to avoid forward declarations and #ifdefs.
diego
parents:
29717
diff
changeset
|
442 } |