From: Andreas Ă–man Date: Wed, 16 Jan 2013 09:19:02 +0000 (+0100) Subject: Avoid reordering teletext streams multiple times... X-Git-Tag: v3.5~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d18ae613dff53d42d0471a9ed85dfb5bf2d3c22;p=thirdparty%2Ftvheadend.git Avoid reordering teletext streams multiple times... ...thus causing continious service restarts This happens if multiple teletext descriptors point to the same page --- diff --git a/src/psi.c b/src/psi.c index 7ed7a8dd0..374815bf1 100644 --- a/src/psi.c +++ b/src/psi.c @@ -347,9 +347,9 @@ psi_desc_teletext(service_t *t, const uint8_t *ptr, int size, if((st = service_stream_find(t, pid)) == NULL) { r |= PMT_UPDATE_NEW_STREAM; st = service_stream_create(t, pid, SCT_TEXTSUB); + st->es_delete_me = 1; } - st->es_delete_me = 0; lang = lang_code_get2((const char*)ptr, 3); if(memcmp(st->es_lang,lang,3)) { @@ -362,10 +362,12 @@ psi_desc_teletext(service_t *t, const uint8_t *ptr, int size, st->es_parent_pid = parent_pid; } - if(st->es_position != *position) { + // Check es_delete_me so we only compute position once per PMT update + if(st->es_position != *position && st->es_delete_me) { st->es_position = *position; r |= PMT_REORDERED; } + st->es_delete_me = 0; (*position)++; } ptr += 5;