From 7f54c1c0e45e09b1d3786bc485461124a42fb949 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 11 Jan 2013 10:01:51 +0000 Subject: [PATCH] timeshift: ensure that timeshift_enabled flag is properly honoured. --- src/htsp_server.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/htsp_server.c b/src/htsp_server.c index 5cb05edc..fe135815 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -282,7 +282,8 @@ htsp_subscription_destroy(htsp_connection_t *htsp, htsp_subscription_t *hs) tsfix_destroy(hs->hs_tsfix); htsp_flush_queue(htsp, &hs->hs_q); #if ENABLE_TIMESHIFT - if(hs->hs_tshift) timeshift_destroy(hs->hs_tshift); + if(hs->hs_tshift) + timeshift_destroy(hs->hs_tshift); #endif free(hs); } @@ -1241,7 +1242,7 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in) { uint32_t chid, sid, weight, req90khz, normts; #if ENABLE_TIMESHIFT - uint32_t timeshiftPeriod; + uint32_t timeshiftPeriod = 0; #endif channel_t *ch; htsp_subscription_t *hs; @@ -1265,9 +1266,11 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in) normts = htsmsg_get_u32_or_default(in, "normts", 0); #if ENABLE_TIMESHIFT - timeshiftPeriod = htsmsg_get_u32_or_default(in, "timeshiftPeriod", 0); - if (!timeshift_unlimited_period) - timeshiftPeriod = MIN(timeshiftPeriod, timeshift_max_period); + if (timeshift_enabled) { + timeshiftPeriod = htsmsg_get_u32_or_default(in, "timeshiftPeriod", 0); + if (!timeshift_unlimited_period) + timeshiftPeriod = MIN(timeshiftPeriod, timeshift_max_period); + } #endif /*