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
return -1;
pids->pids = p;
pids->alloc = alloc;
+ pids->count = 0;
pids->all = 0;
if (vals) {
memcpy(p, vals, count * sizeof(*pids));
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;
+}
}
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);