1
|
|
2
|
// While loop from within dvb_adapter_input_dvr function from dvb_adapter.c
|
3
|
|
4
|
while(1) {
|
5
|
|
6
|
/* Wait for input */
|
7
|
nfds = epoll_wait(efd, &ev, 1, -1);
|
8
|
if (nfds < 1) continue;
|
9
|
if (ev.data.fd != fd) break;
|
10
|
printf("\nSteveo: dvb_adapter_input_dvr got input, r = 0x%x, i = 0x%x", r, i);
|
11
|
fflush(NULL);
|
12
|
|
13
|
c = read(fd, tsb+r, sizeof(tsb)-r);
|
14
|
if (c < 0) {
|
15
|
if (errno == EAGAIN || errno == EINTR)
|
16
|
continue;
|
17
|
else if (errno == EOVERFLOW) {
|
18
|
tvhlog(LOG_WARNING, "dvb", "\"%s\" read() EOVERFLOW",
|
19
|
tda->tda_identifier);
|
20
|
continue;
|
21
|
} else {
|
22
|
// TODO: should we try to recover?
|
23
|
tvhlog(LOG_ERR, "dvb", "\"%s\" read() error %d",
|
24
|
tda->tda_identifier, errno);
|
25
|
break;
|
26
|
}
|
27
|
}
|
28
|
r += c;
|
29
|
|
30
|
/* not enough data */
|
31
|
if (r < 188) continue;
|
32
|
|
33
|
pthread_mutex_lock(&tda->tda_delivery_mutex);
|
34
|
|
35
|
printf("\nSteveo: dvb_adapter_input_dvr lock ON, r = 0x%x, i = 0x%x", r, i);
|
36
|
fflush(NULL);
|
37
|
|
38
|
/* debug */
|
39
|
if(tda->tda_dump_fd != -1) {
|
40
|
if(write(tda->tda_dump_fd, tsb, r) != r) {
|
41
|
tvhlog(LOG_ERR, "dvb",
|
42
|
"\"%s\" unable to write to mux dump file -- %s",
|
43
|
tda->tda_identifier, strerror(errno));
|
44
|
close(tda->tda_dump_fd);
|
45
|
tda->tda_dump_fd = -1;
|
46
|
}
|
47
|
}
|
48
|
|
49
|
/* Process */
|
50
|
printf("\nSteveo: dvb_adapter_input_dvr --starting to process");
|
51
|
fflush(NULL);
|
52
|
|
53
|
while (r >= 188) {
|
54
|
|
55
|
/* sync */
|
56
|
if (tsb[i] == 0x47) {
|
57
|
LIST_FOREACH(t, &tda->tda_transports, s_active_link)
|
58
|
if(t->s_dvb_mux_instance == tda->tda_mux_current)
|
59
|
ts_recv_packet1(t, tsb + i, NULL);
|
60
|
i += 188;
|
61
|
r -= 188;
|
62
|
|
63
|
/* no sync */
|
64
|
} else {
|
65
|
printf("\nSteveo: dvb_adapter_input_dvr --no sync");
|
66
|
fflush(NULL);
|
67
|
|
68
|
|
69
|
tvhlog(LOG_DEBUG, "dvb", "\"%s\" ts sync lost", tda->tda_identifier);
|
70
|
if (ts_resync(tsb, &r, &i)) break;
|
71
|
tvhlog(LOG_DEBUG, "dvb", "\"%s\" ts sync found", tda->tda_identifier);
|
72
|
}
|
73
|
}
|
74
|
|
75
|
pthread_mutex_unlock(&tda->tda_delivery_mutex);
|
76
|
printf("\nSteveo: dvb_adapter_input_dvr lock OFF, r = 0x%x, i = 0x%x", r, i);
|
77
|
fflush(NULL);
|
78
|
|
79
|
/* reset buffer */
|
80
|
if (r)
|
81
|
{
|
82
|
printf("\nSteveo: dvb_adapter_input_dvr --memmove");
|
83
|
fflush(NULL);
|
84
|
|
85
|
memmove(tsb, tsb+i, r);
|
86
|
}
|
87
|
i = 0;
|
88
|
}
|
89
|
printf("\nSteveo: dvb_adapter_input_dvr After while loop ");
|
90
|
fflush(NULL);
|
91
|
|
92
|
|
93
|
|
94
|
|
95
|
|
96
|
******************************************************************************
|
97
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
98
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
99
|
Steveo: dvb_adapter_input_dvr --starting to process
|
100
|
Steveo: sm_type = 0x0
|
101
|
Steveo: Exiting dvr_rec_set_state
|
102
|
Steveo: muxer_write_pkt
|
103
|
Steveo: sm_type = 0x0
|
104
|
Steveo: Exiting dvr_rec_set_state
|
105
|
Steveo: muxer_write_pkt
|
106
|
Steveo: sm_type = 0x0
|
107
|
Steveo: Exiting dvr_rec_set_state
|
108
|
Steveo: muxer_write_pkt
|
109
|
Steveo: sm_type = 0x0
|
110
|
Steveo: Exiting dvr_rec_set_state
|
111
|
Steveo: muxer_write_pkt
|
112
|
Steveo: sm_type = 0x0
|
113
|
Steveo: Exiting dvr_rec_set_state
|
114
|
Steveo: muxer_write_pkt
|
115
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
116
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
117
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
118
|
Steveo: dvb_adapter_input_dvr --starting to process
|
119
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
120
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
121
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
122
|
Steveo: dvb_adapter_input_dvr --starting to process
|
123
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
124
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
125
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
126
|
Steveo: dvb_adapter_input_dvr --starting to process
|
127
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
128
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
129
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
130
|
Steveo: dvb_adapter_input_dvr --starting to process
|
131
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
132
|
Steveo: sm_type = 0x0
|
133
|
Steveo: Exiting dvr_rec_set_state
|
134
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
135
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
136
|
Steveo: muxer_write_pkt
|
137
|
Steveo: dvb_adapter_input_dvr --starting to process
|
138
|
Steveo: sm_type = 0x0
|
139
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
140
|
Steveo: Exiting dvr_rec_set_state
|
141
|
Steveo: muxer_write_pkt
|
142
|
Steveo: sm_type = 0x0
|
143
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
144
|
Steveo: Exiting dvr_rec_set_state
|
145
|
Steveo: muxer_write_pkt
|
146
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
147
|
Steveo: dvb_adapter_input_dvr --starting to process
|
148
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
149
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
150
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
151
|
Steveo: dvb_adapter_input_dvr --starting to process
|
152
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
153
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
154
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x234, i = 0x0
|
155
|
Steveo: dvb_adapter_input_dvr --starting to process
|
156
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x234
|
157
|
Steveo: sm_type = 0x0
|
158
|
Steveo: Exiting dvr_rec_set_state
|
159
|
Steveo: muxer_write_pkt
|
160
|
Steveo: sm_type = 0x0
|
161
|
Steveo: Exiting dvr_rec_set_state
|
162
|
Steveo: muxer_write_pkt
|
163
|
Steveo: sm_type = 0x0
|
164
|
Steveo: Exiting dvr_rec_set_state
|
165
|
Steveo: muxer_write_pkt
|
166
|
Steveo: sm_type = 0x0
|
167
|
Steveo: Exiting dvr_rec_set_state
|
168
|
Steveo: muxer_write_pkt
|
169
|
Steveo: sm_type = 0x0
|
170
|
Steveo: Exiting dvr_rec_set_state
|
171
|
Steveo: muxer_write_pkt
|
172
|
Steveo: sm_type = 0x0
|
173
|
Steveo: Exiting dvr_rec_set_state
|
174
|
Steveo: muxer_write_pkt
|
175
|
Steveo: sm_type = 0x0
|
176
|
Steveo: Exiting dvr_rec_set_state
|
177
|
Steveo: muxer_write_pkt
|
178
|
Steveo: sm_type = 0x0
|
179
|
Steveo: Exiting dvr_rec_set_state
|
180
|
Steveo: muxer_write_pkt
|
181
|
Steveo: sm_type = 0x0
|
182
|
Steveo: Exiting dvr_rec_set_state
|
183
|
Steveo: muxer_write_pkt
|
184
|
Steveo: sm_type = 0x0
|
185
|
Steveo: Exiting dvr_rec_set_state
|
186
|
Steveo: muxer_write_pkt
|
187
|
Steveo: sm_type = 0x0
|
188
|
Steveo: Exiting dvr_rec_set_state
|
189
|
Steveo: muxer_write_pkt
|
190
|
Steveo: sm_type = 0x0
|
191
|
Steveo: Exiting dvr_rec_set_state
|
192
|
Steveo: muxer_write_pkt
|
193
|
Steveo: sm_type = 0x0
|
194
|
Steveo: Exiting dvr_rec_set_state
|
195
|
Steveo: muxer_write_pkt
|
196
|
Steveo: sm_type = 0x0
|
197
|
Steveo: Exiting dvr_rec_set_state
|
198
|
Steveo: muxer_write_pkt
|
199
|
Steveo: sm_type = 0x0
|
200
|
Steveo: Exiting dvr_rec_set_state
|
201
|
Steveo: muxer_write_pkt
|
202
|
Steveo: sm_type = 0x0
|
203
|
Steveo: Exiting dvr_rec_set_state
|
204
|
Steveo: muxer_write_pkt
|
205
|
Steveo: sm_type = 0x0
|
206
|
Steveo: Exiting dvr_rec_set_state
|
207
|
Steveo: muxer_write_pkt
|
208
|
Steveo: sm_type = 0x0
|
209
|
Steveo: Exiting dvr_rec_set_state
|
210
|
Steveo: muxer_write_pkt
|
211
|
Steveo: sm_type = 0x0
|
212
|
Steveo: Exiting dvr_rec_set_state
|
213
|
Steveo: muxer_write_pkt
|
214
|
Steveo: sm_type = 0x0
|
215
|
Steveo: Exiting dvr_rec_set_state
|
216
|
Steveo: muxer_write_pkt
|
217
|
Steveo: sm_type = 0x0
|
218
|
Steveo: Exiting dvr_rec_set_state
|
219
|
Steveo: muxer_write_pkt
|
220
|
Steveo: sm_type = 0x3
|
221
|
Steveo: sm_type = 0x3
|
222
|
Steveo: sm_type = 0x3
|
223
|
Steveo: sm_type = 0x3
|
224
|
Steveo: sm_type = 0x3
|
225
|
Steveo: sm_type = 0x3
|
226
|
Steveo: sm_type = 0x3
|
227
|
Steveo: sm_type = 0x3
|
228
|
Steveo: sm_type = 0x3
|
229
|
|
230
|
******************************************************************************
|
231
|
|
232
|
Steveo: dvb_adapter_input_dvr --starting to process
|
233
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
234
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
235
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
236
|
Steveo: dvb_adapter_input_dvr --starting to process
|
237
|
Steveo: sm_type = 0x0
|
238
|
Steveo: Exiting dvr_rec_set_state
|
239
|
Steveo: muxer_write_pkt
|
240
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
241
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
242
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
243
|
Steveo: dvb_adapter_input_dvr --starting to process
|
244
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
245
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
246
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
247
|
Steveo: dvb_adapter_input_dvr --starting to process
|
248
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
249
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
250
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
251
|
Steveo: dvb_adapter_input_dvr --starting to process
|
252
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
253
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
254
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
255
|
Steveo: dvb_adapter_input_dvr --starting to process
|
256
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
257
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
258
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
259
|
Steveo: dvb_adapter_input_dvr --starting to process
|
260
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
261
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
262
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
263
|
Steveo: dvb_adapter_input_dvr --starting to process
|
264
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
265
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
266
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
267
|
Steveo: dvb_adapter_input_dvr --starting to process
|
268
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
269
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
270
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
271
|
Steveo: dvb_adapter_input_dvr --starting to process
|
272
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
273
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
274
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
275
|
Steveo: dvb_adapter_input_dvr --starting to process
|
276
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
277
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
278
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
279
|
Steveo: dvb_adapter_input_dvr --starting to process
|
280
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
281
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
282
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
283
|
Steveo: dvb_adapter_input_dvr --starting to process
|
284
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
285
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
286
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
287
|
Steveo: dvb_adapter_input_dvr --starting to process
|
288
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
289
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
290
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
291
|
Steveo: dvb_adapter_input_dvr --starting to process
|
292
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
293
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
294
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
295
|
Steveo: dvb_adapter_input_dvr --starting to process
|
296
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
297
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
298
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
299
|
Steveo: dvb_adapter_input_dvr --starting to process
|
300
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
301
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
302
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
303
|
Steveo: dvb_adapter_input_dvr --starting to process
|
304
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
305
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
306
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
307
|
Steveo: dvb_adapter_input_dvr --starting to process
|
308
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
309
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
310
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
311
|
Steveo: dvb_adapter_input_dvr --starting to process
|
312
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
313
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
314
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
315
|
Steveo: dvb_adapter_input_dvr --starting to process
|
316
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
317
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
318
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
319
|
Steveo: dvb_adapter_input_dvr --starting to process
|
320
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
321
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
322
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
323
|
Steveo: dvb_adapter_input_dvr --starting to process
|
324
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
325
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
326
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
327
|
Steveo: dvb_adapter_input_dvr --starting to process
|
328
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
329
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
330
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
331
|
Steveo: dvb_adapter_input_dvr --starting to process
|
332
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
333
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
334
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
335
|
Steveo: dvb_adapter_input_dvr --starting to process
|
336
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
337
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
338
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
339
|
Steveo: dvb_adapter_input_dvr --starting to process
|
340
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
341
|
Steveo: dvb_adapter_input_dvr got input, r = 0x0, i = 0x0
|
342
|
Steveo: dvb_adapter_input_dvr lock ON, r = 0x758, i = 0x0
|
343
|
Steveo: dvb_adapter_input_dvr --starting to process
|
344
|
Steveo: dvb_adapter_input_dvr lock OFF, r = 0x0, i = 0x758
|
345
|
Steveo: sm_type = 0x3
|
346
|
Steveo: sm_type = 0x3
|
347
|
Steveo: sm_type = 0x3
|
348
|
Steveo: sm_type = 0x3
|
349
|
Steveo: sm_type = 0x3
|
350
|
Steveo: sm_type = 0x3
|
351
|
Steveo: sm_type = 0x3
|
352
|
Steveo: sm_type = 0x3
|
353
|
Steveo: sm_type = 0x3
|
354
|
Steveo: sm_type = 0x3
|
355
|
Steveo: sm_type = 0x3
|