int tfs_seen;
+ struct tfstream *tfs_parent;
+
} tfstream_t;
(tfs->tfs_video && pkt->pkt_frametype == PKT_I_FRAME))) {
threshold = 22500;
LIST_FOREACH(tfs2, &tf->tf_streams, tfs_link)
- if (tfs != tfs2 && tfs2->tfs_audio && tfs2->tfs_video && !tfs2->tfs_seen) {
+ if (tfs != tfs2 && (tfs2->tfs_audio || tfs2->tfs_video) && !tfs2->tfs_seen) {
threshold = 90000;
break;
}
} else {
tfs->tfs_local_ref = tf->tf_tsref;
}
+ } else if (tfs->tfs_type == SCT_DVBSUB) {
+ diff = tsfix_ts_diff(tf->tf_tsref, pkt->pkt_dts);
+ if (diff > 2 * 90000) {
+ LIST_FOREACH(tfs2, &tf->tf_streams, tfs_link) {
+ if(tfs2->tfs_audio && tfs2->tfs_local_ref != PTS_UNSET) {
+ tvhwarn("parser", "The timediff for DVBSUB is big (%"PRId64"), using audio dts", diff);
+ tfs->tfs_parent = tfs2;
+ break;
+ }
+ }
+ if (tfs2 == NULL) {
+ pkt_ref_dec(pkt);
+ return;
+ }
+ tfs->tfs_local_ref = tfs2->tfs_local_ref;
+ }
} else if (tfs->tfs_type == SCT_TELETEXT) {
diff = tsfix_ts_diff(tf->tf_tsref, pkt->pkt_dts);
if (diff > 2 * 90000) {
tfs->tfs_last_dts_in, pdur, pkt->pkt_dts);
}
+ if (tfs->tfs_parent)
+ pkt->pkt_dts = pkt->pkt_pts = tfs->tfs_parent->tfs_last_dts_in;
+
tfs->tfs_last_dts_in = pkt->pkt_dts;
compute_pts(tf, tfs, pkt);