mpegts pid: add mpegts_pid_dump(), fix mpegts_pid_init()
This commit is contained in:
parent
2dfc2710b7
commit
af7e0a385d
3 changed files with 19 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue