fix tscheck and add option to not open dvr demux

This commit is contained in:
none
2020-08-29 14:38:09 +02:00
parent bb5e9e7f39
commit 982dc4d366
5 changed files with 40 additions and 32 deletions

View File

@@ -89,6 +89,7 @@ LIBDDDVB_EXPORTED struct dddvb *dddvb_init(char *config, uint32_t flags)
dddvb_dvb_init(dd);
global_dd = dd;
dd->get_ts = 1;
fail:
pthread_mutex_unlock(&dddvb_mutex);
return dd;

View File

@@ -150,6 +150,9 @@ struct dddvb {
struct dddvb_fe dvbfe[DDDVB_MAX_DVB_FE];
struct dddvb_ca dvbca[DDDVB_MAX_DVB_CA];
unsigned int get_ts:1;
};
int dddvb_dvb_init(struct dddvb *dd);

View File

@@ -531,7 +531,7 @@ static int tune(struct dddvb_fe *fe)
return ret;
}
static int open_dmx(struct dddvb_fe *fe)
int open_dmx(struct dddvb_fe *fe)
{
char fname[80];
struct dmx_pes_filter_params pesFilterParams;
@@ -623,10 +623,9 @@ void dddvb_fe_handle(struct dddvb_fe *fe)
uint32_t newtune, count = 0, max, nolock = 0;
int ret;
printf("fe_handle\n");
open_dmx(fe);
printf("fe_handle 2\n");
if (fe->dd->get_ts)
open_dmx(fe);
while (fe->state == 1) {
pthread_mutex_lock(&fe->mutex);
newtune = fe->n_tune;

View File

@@ -64,6 +64,9 @@ LIBDDDVB_EXPORTED int dddvb_ca_write(struct dddvb *dd, uint32_t nr, uint8_t *buf
LIBDDDVB_EXPORTED int dddvb_ca_read(struct dddvb *dd, uint32_t nr, uint8_t *buf, uint32_t len);
LIBDDDVB_EXPORTED int dddvb_ca_set_pmts(struct dddvb *dd, uint32_t nr, uint8_t **pmts);
static inline void dddvb_get_ts(struct dddvb *dd, uint32_t val) {
dd->get_ts = val;
};
static inline void dddvb_set_frequency(struct dddvb_params *p, uint32_t freq) {
p->param[PARAM_FREQ] = freq;