]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Avoid reordering teletext streams multiple times...
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 16 Jan 2013 09:19:02 +0000 (10:19 +0100)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 16 Jan 2013 09:19:07 +0000 (10:19 +0100)
...thus causing continious service restarts
This happens if multiple teletext descriptors point to the same page

src/psi.c

index 7ed7a8dd0a2bc2c9a36c2442c9ae791bbf95663a..374815bf1c4e67066128c667e36d243d36acf41b 100644 (file)
--- 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;