Fix possible problem with duplicate visibility of summary records.

This commit is contained in:
Adam Sutton 2012-06-26 21:42:30 +01:00
parent fcec82f11e
commit 676dd7e291

View file

@ -410,13 +410,11 @@ static int _opentv_parse_event
ev->eid = ((uint16_t)buf[0] << 8) | buf[1];
/* Get existing summary */
if ( type == OPENTV_TITLE ) {
e = RB_FIND(&_opentv_events, ev, ev_link, _ev_cmp);
if (e) {
RB_REMOVE(&_opentv_events, e, ev_link);
memcpy(ev, e, sizeof(opentv_event_t));
free(e);
}
e = RB_FIND(&_opentv_events, ev, ev_link, _ev_cmp);
if (e) {
RB_REMOVE(&_opentv_events, e, ev_link);
memcpy(ev, e, sizeof(opentv_event_t));
free(e);
}
ev->type |= type;