return char_table[off];
}
-static void
+static int
extract_subtitle(mpegts_service_t *t, elementary_stream_t *st,
tt_mag_t *ttm, int64_t pts)
{
}
if(off == 0 && st->es_blank)
- return; // Avoid multiple blank subtitles
+ return 0; // Avoid multiple blank subtitles
st->es_blank = !off;
- if(st->es_curpts == pts)
- pts++; // Avoid non-monotonic PTS
-
- st->es_curpts = pts;
-
sub[off++] = 0;
-
+
th_pkt_t *pkt = pkt_alloc(sub, off, pts, pts);
pkt->pkt_componentindex = st->es_index;
/* Decrease our own reference to the packet */
pkt_ref_dec(pkt);
+
+ return 1;
}
/**
TAILQ_FOREACH(st, &t->s_components, es_link) {
if(parent->es_pid == st->es_parent_pid &&
ttm->ttm_curpage == st->es_pid - PID_TELETEXT_BASE) {
- extract_subtitle(t, st, ttm, ttm->ttm_current_pts);
+ if (extract_subtitle(t, st, ttm, ttm->ttm_current_pts))
+ ttm->ttm_current_pts++; // Avoid duplicate (non-monotonic) PTS
}
}
}