diff --git a/src/input/mpegts.h b/src/input/mpegts.h index c6e9325e..136d773c 100644 --- a/src/input/mpegts.h +++ b/src/input/mpegts.h @@ -99,6 +99,7 @@ static inline int mpegts_pid_exists ( mpegts_apids_t *pids, mpegts_apid_t pid ) int mpegts_pid_copy ( mpegts_apids_t *dst, mpegts_apids_t *src ); int mpegts_pid_compare ( mpegts_apids_t *dst, mpegts_apids_t *src, mpegts_apids_t *add, mpegts_apids_t *del ); +int mpegts_pid_dump ( mpegts_apids_t *pids, char *buf, int len ); /* ************************************************************************** * Data / SI processing diff --git a/src/input/mpegts/mpegts_pid.c b/src/input/mpegts/mpegts_pid.c index 1d645173..8bbea603 100644 --- a/src/input/mpegts/mpegts_pid.c +++ b/src/input/mpegts/mpegts_pid.c @@ -29,6 +29,7 @@ mpegts_pid_init(mpegts_apids_t *pids, mpegts_apid_t *vals, int count) return -1; pids->pids = p; pids->alloc = alloc; + pids->count = 0; pids->all = 0; if (vals) { memcpy(p, vals, count * sizeof(*pids)); @@ -177,3 +178,16 @@ mpegts_pid_compare(mpegts_apids_t *dst, mpegts_apids_t *src, mpegts_pid_add(add, dst->pids[i]); return add->count || del->count; } + +int +mpegts_pid_dump(mpegts_apids_t *pids, char *buf, int len) +{ + int i, l = 0; + + if (pids->all) + return snprintf(buf, len, "all"); + for (i = 0; i < pids->count; i++) + l += snprintf(buf + l, len - l, "%s%i", + i > 0 ? "," : "", pids->pids[i]); + return l; +} diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index c41fa4e4..a6b82173 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -828,15 +828,14 @@ play: } if (setup) - tvhdebug("satips", "setup from %s:%d, RTP: %d, RTCP: %d", + tvhdebug("satips", "setup from %s:%d, RTP: %d, RTCP: %d, pids ", addrbuf, IP_PORT(*hc->hc_peer), rs->rtp_peer_port, rs->rtp_peer_port + 1); + dvb_mux_conf_str(dmc, buf, sizeof(buf)); s = buf + strlen(buf); - for (r = 0; r < rs->pids.count; r++) { - s += snprintf(s, sizeof(buf) - (s - buf), "%s%i", - r > 0 ? "," : " pids ", rs->pids.pids[r]); - } + mpegts_pid_dump(&rs->pids, s, sizeof(buf) - (s - buf)); + tvhdebug("satips", "%i/%s/%d: %s %s", rs->frontend, rs->session, rs->stream, setup ? "setup" : "play", buf);