Re: Is this a bug?(About multi-sections)

Jean-Paul Saman <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <CAK9US3AbmOxgMdv7=+UzcNyREW8=AoiYPam+y3jDnyiscQr_rg@mail.gmail.com>
Hi Fred,

On Wed, Dec 5, 2012 at 9:32 AM, Josep Maria Galcerán
<[email protected]>wrote:

> **
> Hi all,
> from ISO/IEC 13818-1, Annex C, C.2 iii):
>
> "The section_number field allows the sections of a particular table to be
> reassembled in their original order
> by the decoder. There is no obligation within this Recommendation |
> International Standard that sections
> must be transmitted in numerical order, but this is recommended, unless it
> is desired to transmit some
> sections of the table more frequently than others, e.g. due to random
> access considerations."
>
> Regards
> Josep
>

Please test the attached patch is should solve the issue.  Let me know
about the results.

Kind regards,

Jean-Paul Saman.

_______________________________________________
libdvbpsi-devel mailing list
[email protected]
http://mailman.videolan.org/listinfo/libdvbpsi-devel
0001-src-dvbpsi.c-dvbpsi_decoder_psi_sections_completed-d.patch (application/octet-stream, 2 KB)
From 6d7d5422ed6315527f8368cf198d66c5095255d2 Mon Sep 17 00:00:00 2001
From: Jean-Paul Saman <[email protected]>
Date: Wed, 5 Dec 2012 10:05:26 +0100
Subject: [PATCH] src/dvbpsi.c: dvbpsi_decoder_psi_sections_completed: detect
 gaps in multi section psi tables

The function dvbpsi_decoder_psi_sections_completed() is meant to detect if all
sections of a multi section psi table have arrived. After the rewrite in
commit-id 57c6cd63 it ignored gaps in the arrived sections. This means that
the function now expects that individual sections of multi section psi tables
arrive in order. However the ISO/IEC 13818-1 standard explains in Annex C, C 2ii
that it is allowed to transmit sections out of order.

 "The section_number field allows the sections of a particular table to be reassembled
  in their original order by the decoder. There is no obligation within this Recommendation
  | International Standard that sections must be transmitted in numerical order, but this
  is recommended, unless it is desired to transmit some sections of the table more frequently
  than others, e.g. due to random access considerations."

The p_decoder->p_sections linked list is sequentially ordered and is now changed to detect
a gap in the ordering. This is possible because the first section in a multi-section psi table
is numbered 0.
---
 src/dvbpsi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/dvbpsi.c b/src/dvbpsi.c
index 0555b14..061a9d6 100644
--- a/src/dvbpsi.c
+++ b/src/dvbpsi.c
@@ -221,11 +221,16 @@ bool dvbpsi_decoder_psi_sections_completed(dvbpsi_decoder_t* p_decoder)
     bool b_complete = false;
 
     dvbpsi_psi_section_t *p = p_decoder->p_sections;
+    unsigned int prev_nr = 0;
     while (p)
     {
+        assert(prev_nr < 256);
+        if (prev_nr != p->i_number)
+            break;
         if (p_decoder->i_last_section_number == p->i_number)
             b_complete = true;
         p = p->p_next;
+        prev_nr++;
     }
 
     return b_complete;
-- 
1.7.11.7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.