.off = offsetof(timeshift_conf_t, ram_fit),
.opts = PO_EXPERT,
},
+ {
+ .type = PT_BOOL,
+ .id = "teletext",
+ .name = N_("Include teletext"),
+ .desc = N_("Include the teletext stream to the timeshift buffer. It may cause "
+ "issues for channels where the teletext DTS is invalid."),
+ .off = offsetof(timeshift_conf_t, teletext),
+ .opts = PO_EXPERT,
+ },
{}
}
};
int file_segments; ///< Count of segments in files
int vididx; ///< Index of (current) video stream
+ int teletextidx; ///< Index of (current) teletext stream
streaming_start_t *smt_start; ///< Streaming start info
ts->vididx = ss->ss_components[i].ssc_index;
break;
}
+ /* Update teletext index */
+ for (i = 0; i < ss->ss_num_components; i++)
+ if (ss->ss_components[i].ssc_type == SCT_TELETEXT) {
+ ts->teletextidx = ss->ss_components[i].ssc_index;
+ break;
+ }
}
/*
static void _process_msg
( timeshift_t *ts, streaming_message_t *sm, int *run )
{
- int err;
+ int err, teletext = 0;
timeshift_file_t *tsf;
+ th_pkt_t *pkt;
/* Process */
switch (sm->sm_type) {
goto live;
/* Store */
+ case SMT_PACKET:
+ if (timeshift_conf.teletext && sm->sm_type == SMT_PACKET) {
+ pkt = sm->sm_data;
+ teletext = pkt->pkt_componentindex == ts->teletextidx;
+ }
+ /* fall thru */
case SMT_SIGNAL_STATUS:
case SMT_START:
case SMT_MPEGTS:
- case SMT_PACKET:
pthread_mutex_lock(&ts->state_mutex);
- ts->buf_time = sm->sm_time;
+ if (!teletext) /* do not use time from teletext packets */
+ ts->buf_time = sm->sm_time;
if (ts->state == TS_LIVE) {
streaming_target_deliver2(ts->output, streaming_msg_clone(sm));
if (sm->sm_type == SMT_PACKET)
if (sm->sm_type == SMT_START)
_update_smt_start(ts, (streaming_start_t *)sm->sm_data);
if (ts->dobuf) {
+ if (teletext) /* do not save teletext packets */
+ goto end;
if ((tsf = timeshift_filemgr_get(ts, sm->sm_time)) != NULL) {
if (tsf->wfd >= 0 || tsf->ram) {
if ((err = _process_msg0(ts, tsf, sm)) < 0) {
}
/* Next */
+end:
streaming_msg_free(sm);
return;