]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
profile: fix timeshift creation for htsp profile, add more timeshift logs
authorJaroslav Kysela <perex@perex.cz>
Thu, 23 Oct 2014 09:15:03 +0000 (11:15 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 23 Oct 2014 09:15:03 +0000 (11:15 +0200)
src/htsp_server.c
src/profile.c

index 268d497a784f959b83b54f01b2943664186a2f93..4716edd7d50093c8c1ba2be6670f6bbe1caf7504 100644 (file)
@@ -1757,7 +1757,6 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in)
       tvhlog(LOG_DEBUG, "htsp", "using timeshift buffer (unlimited)");
     else
       tvhlog(LOG_DEBUG, "htsp", "using timeshift buffer (%u mins)", timeshiftPeriod / 60);
-    pflags |= PRCH_FLAG_TSFIX;
   }
 #endif
 
@@ -1887,9 +1886,12 @@ htsp_method_skip(htsp_connection_t *htsp, htsmsg_t *in)
   if(!htsmsg_get_s64(in, "time", &s64)) {
     skip.type = abs ? SMT_SKIP_ABS_TIME : SMT_SKIP_REL_TIME;
     skip.time = hs->hs_90khz ? s64 : ts_rescale_i(s64, 1000000);
+    tvhtrace("htsp", "skip: %s %"PRId64" (%s)\n", abs ? "abs" : "rel",
+             skip.time, hs->hs_90khz ? "90kHz" : "1MHz");
   } else if (!htsmsg_get_s64(in, "size", &s64)) {
     skip.type = abs ? SMT_SKIP_ABS_SIZE : SMT_SKIP_REL_SIZE;
     skip.size = s64;
+    tvhtrace("htsp", "skip: %s by size %"PRId64, abs ? "abs" : "rel", s64);
   } else {
     return htsp_error("Missing argument 'time' or 'size'");
   }
@@ -1922,6 +1924,7 @@ htsp_method_speed(htsp_connection_t *htsp, htsmsg_t *in)
   if(hs == NULL)
     return htsp_error("Requested subscription does not exist");
 
+  tvhtrace("htsp", "speed: %d", speed);
   subscription_set_speed(hs->hs_s, speed);
 
   htsp_reply(htsp, in, htsmsg_create_map());
@@ -1949,6 +1952,7 @@ htsp_method_live(htsp_connection_t *htsp, htsmsg_t *in)
     return htsp_error("Requested subscription does not exist");
 
   skip.type = SMT_SKIP_LIVE;
+  tvhtrace("htsp", "live");
   subscription_set_skip(hs->hs_s, &skip);
 
   htsp_reply(htsp, in, htsmsg_create_map());
index ea07790e271d4a76d11d5163f8d1e7fdfc698d8e..28cc59420712f1383f472e3aeaf538e5da6712a6 100644 (file)
@@ -538,6 +538,13 @@ profile_htsp_work(profile_chain_t *prch,
                   streaming_target_t *dst,
                   uint32_t timeshift_period, int flags)
 {
+#if ENABLE_TIMESHIFT
+  if (timeshift_period > 0) {
+    dst = prch->prch_timeshift = timeshift_create(dst, timeshift_period);
+    flags |= PRCH_FLAG_TSFIX;
+  }
+#endif
+
   if (flags & PRCH_FLAG_TSFIX)
     dst = prch->prch_tsfix = tsfix_create(dst);