From 777b3484f61c52767c4bf1db391f5512a7f8cba5 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 23 Oct 2014 11:15:03 +0200 Subject: [PATCH] profile: fix timeshift creation for htsp profile, add more timeshift logs --- src/htsp_server.c | 6 +++++- src/profile.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/htsp_server.c b/src/htsp_server.c index 268d497a..4716edd7 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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()); diff --git a/src/profile.c b/src/profile.c index ea07790e..28cc5942 100644 --- a/src/profile.c +++ b/src/profile.c @@ -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);