]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsfix: teletext subs are based on audio clock, move the correction to proper block
authorJaroslav Kysela <perex@perex.cz>
Wed, 15 Feb 2017 10:08:46 +0000 (11:08 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 15 Feb 2017 10:08:46 +0000 (11:08 +0100)
src/plumbing/tsfix.c

index 02bfb83b542a66a24afb29e668b0475fe768b89e..db8e21ec24ee58a91db6fcd70402efcf38aea75e 100644 (file)
@@ -504,13 +504,14 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm)
       } else {
         tfs->tfs_local_ref = tf->tf_tsref;
       }
-    } else if (tfs->tfs_type == SCT_DVBSUB) {
+    } else if (tfs->tfs_type == SCT_DVBSUB || tfs->tfs_type == SCT_TEXTSUB) {
       /* find first valid audio stream and check the dts timediffs */
       LIST_FOREACH(tfs2, &tf->tf_streams, tfs_link)
         if(tfs2->tfs_audio && tfs2->tfs_last_dts_in != PTS_UNSET) {
           diff = tsfix_ts_diff(tfs2->tfs_last_dts_in, pkt->pkt_dts);
           if (diff > 3 * 90000) {
-            tvhwarn(LS_TSFIX, "The timediff for DVBSUB is big (%"PRId64"), using audio dts", diff);
+            tvhwarn(LS_TSFIX, "The timediff for %s is big (%"PRId64"), using audio dts",
+                    streaming_component_type2txt(tfs->tfs_type), diff);
             tfs->tfs_parent = tfs2;
             tfs->tfs_local_ref = tfs2->tfs_local_ref;
           } else {
@@ -525,13 +526,8 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm)
     } else if (tfs->tfs_type == SCT_TELETEXT) {
       diff = tsfix_ts_diff(tf->tf_tsref, pkt->pkt_dts);
       if (diff > 2 * 90000) {
-        tfstream_t *tfs2;
         tvhwarn(LS_TSFIX, "The timediff for TELETEXT is big (%"PRId64"), using current dts", diff);
         tfs->tfs_local_ref = pkt->pkt_dts;
-        /* Text subtitles extracted from teletext have same timebase */
-        LIST_FOREACH(tfs2, &tf->tf_streams, tfs_link)
-          if(tfs2->tfs_type == SCT_TEXTSUB)
-            tfs2->tfs_local_ref = pkt->pkt_dts;
       } else {
         tfs->tfs_local_ref = tf->tf_tsref;
       }