From a9bbd6dbd614988239490f4b617f86f6c4931de7 Mon Sep 17 00:00:00 2001 From: Catalin Toda Date: Thu, 1 Jun 2023 22:28:21 -0700 Subject: [PATCH] Various fixes by Lars #1116 #1115 #1112 --- src/dvb.c | 7 ++++++- src/pmt.c | 5 ++--- src/stream.c | 2 +- src/utils.c | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/dvb.c b/src/dvb.c index 1388972bac..a03de02800 100644 --- a/src/dvb.c +++ b/src/dvb.c @@ -209,8 +209,13 @@ int detect_dvb_parameters(char *s, transponder *tp) { tp->gi = map_int(arg[i] + 3, fe_gi); if (strncmp("tmode=", arg[i], 6) == 0) tp->tmode = map_int(arg[i] + 6, fe_tmode); - if (strncmp("bw=", arg[i], 3) == 0) + if (strncmp("bw=", arg[i], 3) == 0) { tp->bw = map_float(arg[i] + 3, 1000000); + if (tp->bw < 0 || tp->bw > 100000000) // Fix clients that send bw=8000 ! + tp->bw = map_float(arg[i] + 3, 1000); + if (tp->bw < 0 || tp->bw > 100000000) // Fix clients that send bw=8000000 ! + tp->bw = map_float(arg[i] + 3, 1); + } if (strncmp("specinv=", arg[i], 8) == 0) tp->inversion = map_int(arg[i] + 8, NULL); if (strncmp("c2tft=", arg[i], 6) == 0) diff --git a/src/pmt.c b/src/pmt.c index d4ccbfe858..6027aa19d3 100644 --- a/src/pmt.c +++ b/src/pmt.c @@ -650,7 +650,7 @@ char *cw_to_string(SCW *cw, char *buf) { } void clear_cw_for_pmt(int master_pmt, int parity) { - int i, dcw = 0; + int i; int64_t ctime = getTick(); for (i = 0; i < ncws; i++) if (cws[i] && cws[i]->enabled && cws[i]->pmt == master_pmt && @@ -660,7 +660,6 @@ void clear_cw_for_pmt(int master_pmt, int parity) { if (cws[i]->op->stop_cw) cws[i]->op->stop_cw(cws[i], get_pmt(master_pmt)); cws[i]->enabled = 0; - dcw++; } i = MAX_CW; while (--i >= 0) @@ -1111,7 +1110,7 @@ void start_active_pmts(adapter *ad) { memset(pids, 0, sizeof(pids)); for (i = 0; i < MAX_PIDS; i++) - if ((ad->pids[i].flags == 1)) { + if (ad->pids[i].flags == 1) { pids[ad->pids[i].pid] = ad->pids + i; } for (i = 0; i < ad->active_pmts; i++) { diff --git a/src/stream.c b/src/stream.c index d8b8d0d75c..247dbc0db1 100644 --- a/src/stream.c +++ b/src/stream.c @@ -609,7 +609,7 @@ int enqueue_rtp_header(streams *sid, struct iovec *iov, int liov, len = 4; } - copy16(rtp_buf, len + 0, 0x8021); + copy16(rtp_buf, len + 0, (uint32_t)0x8021); copy16(rtp_buf, len + 2, sid->seq); copy32(rtp_buf, len + 4, timestamp); copy32(rtp_buf, len + 8, sid->ssrc); diff --git a/src/utils.c b/src/utils.c index bb3c8f8779..7234122426 100644 --- a/src/utils.c +++ b/src/utils.c @@ -239,10 +239,10 @@ int addr2line(char const *const program_name, void const *const addr) { } void print_trace(void) { +#if !defined(NO_BACKTRACE) void *array[10]; size_t size; size_t i; -#if !defined(NO_BACKTRACE) size = backtrace(array, 10);