]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
timeshift: use pkt->pkt_type instead info from the streaming_start
authorJaroslav Kysela <perex@perex.cz>
Mon, 3 Apr 2017 16:07:38 +0000 (18:07 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 3 Apr 2017 16:07:38 +0000 (18:07 +0200)
src/timeshift.c
src/timeshift/private.h
src/timeshift/timeshift_writer.c

index 0a4bae2797a831da4219954a9a8aca5b7383ade4..4c91fd211d4629e56b9450526b63f4b9b3654f98 100644 (file)
@@ -309,19 +309,6 @@ const idclass_t timeshift_conf_class = {
  * Process a packet
  */
 
-static void
-timeshift_smt_start ( timeshift_t *ts, streaming_start_t *ss )
-{
-  int i;
-
-  /* Update early teletext index */
-  for (i = 0; i < ss->ss_num_components; i++)
-    if (ss->ss_components[i].ssc_type == SCT_TELETEXT) {
-      ts->teletextidx0 = ss->ss_components[i].ssc_index;
-      break;
-    }
-}
-
 static int
 timeshift_packet( timeshift_t *ts, streaming_message_t *sm )
 {
@@ -330,7 +317,7 @@ timeshift_packet( timeshift_t *ts, streaming_message_t *sm )
 
   if (pkt->pkt_pts != PTS_UNSET) {
     /* avoid to update last_wr_time for TELETEXT packets */
-    if (ts->teletextidx0 != pkt->pkt_componentindex) {
+    if (pkt->pkt_type != SCT_TELETEXT) {
       time = ts_rescale(pkt->pkt_pts, 1000000);
       if (ts->last_wr_time < time)
         ts->last_wr_time = time;
@@ -382,9 +369,6 @@ static void timeshift_input
     else if (type == SMT_MPEGTS)
       ts->packet_mode = 0;
 
-    else if (type == SMT_START)
-      timeshift_smt_start(ts, (streaming_start_t *)sm->sm_data);
-
     /* Send to the writer thread */
     if (ts->packet_mode) {
       sm->sm_time = ts->last_wr_time;
index e5fda45143333d059c5db970e38021c03d6dbdc9..fe496df926a7f894fe17f016fba1dab4bc1fe947 100644 (file)
@@ -131,8 +131,6 @@ typedef struct timeshift {
   int                         file_segments; ///< Count of segments in files
 
   int                         vididx;     ///< Index of (current) video stream
-  int                         teletextidx0; ///< Index of (current) teletext stream (EARLY)
-  int                         teletextidx; ///< Index of (current) teletext stream
 
   streaming_start_t          *smt_start;  ///< Streaming start info
 
index 102835e32ca115afde013e11d3a0f8390eddcb1d..8a2a11b7fd789fd8b109cd5e35adc5a32b885a0a 100644 (file)
@@ -249,12 +249,6 @@ static void _update_smt_start ( timeshift_t *ts, streaming_start_t *ss )
       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;
-    }
 }
 
 /*
@@ -353,7 +347,7 @@ static void _process_msg
     case SMT_PACKET:
       if (timeshift_conf.teletext && sm->sm_type == SMT_PACKET) {
         pkt = sm->sm_data;
-        teletext = pkt->pkt_componentindex == ts->teletextidx;
+        teletext = pkt->pkt_type == SCT_TELETEXT;
       }
       /* fall thru */
     case SMT_SIGNAL_STATUS: