Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
profile: fix timeshift creation for htsp profile, add more timeshift …
…logs
  • Loading branch information
perexg committed Oct 23, 2014
1 parent d0ee059 commit 777b348
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/htsp_server.c
Expand Up @@ -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

Expand Down Expand Up @@ -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'");
}
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
7 changes: 7 additions & 0 deletions src/profile.c
Expand Up @@ -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);

Expand Down

0 comments on commit 777b348

Please sign in to comment.