collect bandwidth statistics on direct subscriptions

This commit is contained in:
John Törnblom 2013-01-09 16:14:04 +01:00
parent ea0d6918ff
commit 048856342f

View file

@ -308,6 +308,17 @@ static void
subscription_input_direct(void *opauqe, streaming_message_t *sm)
{
th_subscription_t *s = opauqe;
if(sm->sm_type == SMT_PACKET) {
th_pkt_t *pkt = sm->sm_data;
if(pkt->pkt_err)
s->ths_total_err++;
s->ths_bytes += pkt->pkt_payload->pb_size;
} else if(sm->sm_type == SMT_MPEGTS) {
pktbuf_t *pb = sm->sm_data;
s->ths_bytes += pb->pb_size;
}
streaming_target_deliver(s->ths_output, sm);
}