epggrab_module_t *mod;
epggrab_queued_data_t *eq;
- /* Time for other jobs */
while (atomic_get(&epggrab_running)) {
pthread_mutex_lock(&epggrab_data_mutex);
do {
TAILQ_REMOVE(&epggrab_data_modules, mod, qlink);
}
}
- if (eq == NULL) {
- while (atomic_get(&epggrab_running))
- pthread_cond_wait(&epggrab_data_cond, &epggrab_data_mutex);
- }
+ if (eq == NULL)
+ pthread_cond_wait(&epggrab_data_cond, &epggrab_data_mutex);
} while (eq == NULL && atomic_get(&epggrab_running));
pthread_mutex_unlock(&epggrab_data_mutex);
if (eq) {
memcpy(eq->eq_data + len1, data2, len2);
memoryinfo_alloc(&epggrab_data_memoryinfo, len);
pthread_mutex_lock(&epggrab_data_mutex);
- TAILQ_INSERT_TAIL(&mod->data_queue, eq, eq_link);
if (TAILQ_EMPTY(&mod->data_queue)) {
pthread_cond_signal(&epggrab_data_cond);
TAILQ_INSERT_TAIL(&epggrab_data_modules, mod, qlink);
}
+ TAILQ_INSERT_TAIL(&mod->data_queue, eq, eq_link);
pthread_mutex_unlock(&epggrab_data_mutex);
}
epggrab_cron_multi = NULL;
pthread_mutex_init(&epggrab_mutex, NULL);
+ pthread_mutex_init(&epggrab_data_mutex, NULL);
pthread_cond_init(&epggrab_cond, NULL);
+ pthread_cond_init(&epggrab_data_cond, NULL);
TAILQ_INIT(&epggrab_data_modules);
mpegts_service_t *svc;
channel_t *ch;
eit_event_t ev;
- const uint8_t *ptr = ptr0;
- int r, len = len0;
+ const uint8_t *ptr;
+ int r, len;
uint8_t dtag, dlen;
int dllen;
- if (len < 12) return -1;
+ if (len0 < 12) return -1;
- dllen = ((ptr[10] & 0x0f) << 8) | ptr[11];
- len0 -= 12;
- ptr0 += 12;
+ dllen = ((ptr0[10] & 0x0f) << 8) | ptr0[11];
+ len = len0 - 12;
+ ptr = ptr0 + 12;
- if (len0 < dllen) return -1;
+ if (len < dllen) return -1;
memset(&ev, 0, sizeof(ev));
while (dllen > 2) {
if (ilm)
return -1;
- return 12 + (((ptr[10] & 0x0f) << 8) | ptr[11]);
+ return 12 + (((ptr0[10] & 0x0f) << 8) | ptr0[11]);
}
static void