Re: [RFC] Broken current_next handling for SI tables

Marian Ďurkovič <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <[email protected]>
On Mon, Nov 16, 2009 at 01:38:36PM +0100, Christophe Massiot wrote:
> On Mon, Nov 16, 2009, Marian Ďurkovič wrote:
> 
> >    Thus I strongly believe we should remove this "feature" from libdvbpsi
> > ASAP and make it deliver correct tables at all cases without the need
> > for past-references.
> 
> I fully agree with you, and I'd even go further : we should call back
> the callback function for every table received, even if the version
> number hasn't changed. I've often had problems in production because the
> PAT version didn't change though its content changed (Anevia hardware is
> for instance affected by this bug). You can always say that the received
> stream was invalid, but the guy at the other end will say "hey it is
> valid now, why doesn't your equipment work ??".
> 
> Now if the application decides that it should ignore tables with
> identical version, that's its problem, but a library shouldn't decide
> for it, since the overhead is minimal.

Attached please find a patch which avoids sending empty table for PAT.
The same needs to be applied for other SI tables.

If we want to trigger the callback on every table received, that if() must
go away completely - we should be however prepared to receive PAT/PMT
callbacks quite often (e.g every 75 msec) and kill debug messages like
"PAT Callback called".

 
    With kind regards,

          M.

_______________________________________________
libdvbpsi-devel mailing list
[email protected]
http://mailman.videolan.org/listinfo/libdvbpsi-devel
pat_curr_next.patch (text/x-diff, 1.8 KB)
Index: src/tables/pat.c
===================================================================
--- src/tables/pat.c	(revision 186)
+++ src/tables/pat.c	(working copy)
@@ -265,19 +265,10 @@
       else
       {
         if(    (p_pat_decoder->b_current_valid)
-            && (p_pat_decoder->current_pat.i_version == p_section->i_version))
+            && (p_pat_decoder->current_pat.i_version == p_section->i_version)
+            && (p_pat_decoder->current_pat.b_current_next ==
+                                           p_section->b_current_next))
         {
-          /* Signal a new PAT if the previous one wasn't active */
-          if(    (!p_pat_decoder->current_pat.b_current_next)
-              && (p_section->b_current_next))
-          {
-            dvbpsi_pat_t* p_pat = (dvbpsi_pat_t*)malloc(sizeof(dvbpsi_pat_t));
-
-            p_pat_decoder->current_pat.b_current_next = 1;
-            *p_pat = p_pat_decoder->current_pat;
-            p_pat_decoder->pf_callback(p_pat_decoder->p_cb_data, p_pat);
-          }
-
           /* Don't decode since this version is already decoded */
           b_append = 0;
         }
Index: src/tables/pat.h
===================================================================
--- src/tables/pat.h	(revision 186)
+++ src/tables/pat.h	(working copy)
@@ -27,10 +27,7 @@
  * \brief Application interface for the PAT decoder and the PAT generator.
  *
  * Application interface for the PAT decoder and the PAT generator. New
- * decoded PAT tables are sent by callback to the application. If a table
- * wasn't active (b_current_next == 0) and the next is the same but active
- * (b_current_next == 1) then the program list is empty and should be
- * caught from the previous structure.
+ * decoded PAT tables are sent by callback to the application.
  */
 
 #ifndef _DVBPSI_PAT_H_
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.