Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
change ths_total_err to atomic ops
  • Loading branch information
perexg committed Mar 8, 2016
1 parent 07dc08b commit e2f7e12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/epggrab/module/eit.c
Expand Up @@ -637,7 +637,7 @@ _eit_callback
/* Validate */
if(tableid < 0x4e || tableid > 0x6f || len < 11) {
if (ths)
ths->ths_total_err++;
atomic_add(&ths->ths_total_err, 1);
return -1;
}

Expand Down
8 changes: 4 additions & 4 deletions src/subscriptions.c
Expand Up @@ -471,12 +471,12 @@ subscription_input_direct(void *opauqe, streaming_message_t *sm)
/* Log data and errors */
if(sm->sm_type == SMT_PACKET) {
th_pkt_t *pkt = sm->sm_data;
s->ths_total_err += pkt->pkt_err;
atomic_add(&s->ths_total_err, pkt->pkt_err);
if (pkt->pkt_payload)
subscription_add_bytes_in(s, pkt->pkt_payload->pb_size);
} else if(sm->sm_type == SMT_MPEGTS) {
pktbuf_t *pb = sm->sm_data;
s->ths_total_err += pb->pb_err;
atomic_add(&s->ths_total_err, pb->pb_err);
subscription_add_bytes_in(s, pb->pb_size);
}

Expand Down Expand Up @@ -701,12 +701,12 @@ subscription_create
s->ths_hostname = hostname ? strdup(hostname) : NULL;
s->ths_username = username ? strdup(username) : NULL;
s->ths_client = client ? strdup(client) : NULL;
s->ths_total_err = 0;
s->ths_output = st;
s->ths_flags = flags;
s->ths_timeout = pro ? pro->pro_timeout : 0;
s->ths_postpone = subscription_postpone;
s->ths_postpone_end = mclk() + sec2mono(s->ths_postpone);
atomic_set(&s->ths_total_err, 0);

if (s->ths_prch)
s->ths_weight = profile_chain_weight(s->ths_prch, weight);
Expand Down Expand Up @@ -886,7 +886,7 @@ subscription_create_msg(th_subscription_t *s, const char *lang)

htsmsg_add_u32(m, "id", s->ths_id);
htsmsg_add_u32(m, "start", s->ths_start);
htsmsg_add_u32(m, "errors", s->ths_total_err);
htsmsg_add_u32(m, "errors", atomic_get(&s->ths_total_err));

const char *state;
switch(s->ths_state) {
Expand Down

0 comments on commit e2f7e12

Please sign in to comment.