Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
HTSP server: add errors field to packet statistics
  • Loading branch information
perexg committed Feb 18, 2015
1 parent 2ba84e8 commit ba7ec12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/htsp_server.c
Expand Up @@ -209,6 +209,8 @@ typedef struct htsp_subscription {

int hs_first;

uint32_t hs_data_errors;

} htsp_subscription_t;


Expand Down Expand Up @@ -3234,8 +3236,11 @@ htsp_stream_deliver(htsp_subscription_t *hs, th_pkt_t *pkt)
int qlen = hs->hs_q.hmq_payload;
size_t payloadlen;

if(pkt->pkt_payload == NULL)
if (pkt->pkt_err)
hs->hs_data_errors += pkt->pkt_err;
if(pkt->pkt_payload == NULL) {
return;
}

if(!htsp_is_stream_enabled(hs, pkt->pkt_componentindex)) {
pkt_ref_dec(pkt);
Expand Down Expand Up @@ -3295,6 +3300,8 @@ htsp_stream_deliver(htsp_subscription_t *hs, th_pkt_t *pkt)
htsmsg_add_u32(m, "subscriptionId", hs->hs_sid);
htsmsg_add_u32(m, "packets", hs->hs_q.hmq_length);
htsmsg_add_u32(m, "bytes", hs->hs_q.hmq_payload);
if (hs->hs_data_errors)
htsmsg_add_u32(m, "errors", hs->hs_data_errors);

/**
* Figure out real time queue delay
Expand Down

0 comments on commit ba7ec12

Please sign in to comment.