[libdvbpsi-devel] [Git][videolan/libdvbpsi][branch/1.3.0-bugfix] 4 commits: really identify duplicates

Jean-Paul Saman (@jpsaman) gitlab at videolan.org
Sat Jan 8 14:32:18 UTC 2022



Jean-Paul Saman pushed to branch branch/1.3.0-bugfix at VideoLAN / libdvbpsi


Commits:
3618e216 by Francois Cartegnie at 2021-12-03T13:55:38+01:00
really identify duplicates

(cherry picked from commit 89f23e87351f04be49e25f74ed085a9190ed1045)

- - - - -
769c9929 by Francois Cartegnie at 2021-12-03T13:55:38+01:00
really reset packet counter

(cherry picked from commit 9f2289a6ad82c10050f3817d91711c596f6200e1)

- - - - -
9f7b9d26 by Konstantin Pavlov at 2021-12-03T14:03:05+01:00
Added a configure switch to enable/disable examples build

(cherry picked from commit 5700ed2f2311b3477706bac2fd030b2855720e68)

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
7860d9e7 by Steve Lhomme at 2021-12-03T14:03:05+01:00
update for 1.3.4 release

- - - - -


7 changed files:

- Makefile.am
- NEWS
- configure.ac
- doc/doxygen.cfg
- libdvbpsi.spec.in
- src/dvbpsi.c
- src/dvbpsi.h


Changes:

=====================================
Makefile.am
=====================================
@@ -2,7 +2,12 @@
 
 ACLOCAL_AMFLAGS=-I m4
 
-SUBDIRS = src examples misc
+SUBDIRS = src
+
+if BUILD_EXAMPLES
+SUBDIRS += examples misc
+endif
+
 DIST_SUBDIRS = $(SUBDIRS) doc wince
 
 EXTRA_DIST = libdvbpsi.spec libdvbpsi.spec.in libdvbpsi.pc.in bootstrap
@@ -17,9 +22,6 @@ doc-dummy:
 doc: doc-dummy
 	$(MAKE) -C doc doc
 
-test_dr.c:
-	$(MAKE) -C misc test_dr.c
-
 changelog:
 	cvs2cl --utc --hide-filenames --no-wrap -w --stdout -g -z9 | \
 	  sed -e 's/^[^0-9]/ /' -e 's/^  *$$//' -e 's/^ \* 	/ /g' | \
@@ -32,5 +34,10 @@ dist-checksum: $(DIST_ARCHIVES)
 	  sha256sum $$sum > $$sum.sha256; \
 	done
 
+if BUILD_EXAMPLES
+test_dr.c:
+	$(MAKE) -C misc test_dr.c
+
 generate-header_dr:
 	misc/gen_dr_h.sh > src/descriptors/dr.h
+endif


=====================================
NEWS
=====================================
@@ -1,3 +1,8 @@
+Changes between 1.3.3 and 1.3.4:
+-------------------------------
+
+ * Fix duplicate detection
+
 Changes between 1.3.2 and 1.3.3:
 -------------------------------
 


=====================================
configure.ac
=====================================
@@ -1,4 +1,4 @@
-AC_INIT([libdvbpsi], [1.3.3])
+AC_INIT([libdvbpsi], [1.3.4])
 
 AC_PREREQ([2.50])
 AC_CONFIG_AUX_DIR([.auto])
@@ -132,6 +132,16 @@ if test "${ac_cv_asprintf}" != "no"; then
     AC_DEFINE(HAVE_ASPRINTF, 1, [Support for asprintf() and vasprintf()])
 fi
 
+# dnl Whether or not build examples
+AC_ARG_ENABLE([examples],
+  [AS_HELP_STRING([--enable-examples],
+  [build examples (default is yes)])],
+  [build_examples=$enableval],
+  [build_examples=yes])
+
+dnl use examples
+AM_CONDITIONAL([BUILD_EXAMPLES], [ test $build_examples = "yes" ])
+
 dnl
 dnl Generate Makefiles and other output files
 dnl
@@ -153,4 +163,5 @@ debug                 : ${debug}
 release               : ${release}
 compile flags         : ${CFLAGS}
 build for             : ${SYS}
+build examples        : ${build_examples}
 "


=====================================
doc/doxygen.cfg
=====================================
@@ -38,7 +38,7 @@ PROJECT_NAME           = libdvbpsi
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 1.3.3
+PROJECT_NUMBER         = 1.3.4
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a


=====================================
libdvbpsi.spec.in
=====================================
@@ -78,6 +78,9 @@ rm -rf %buildroot
 %{_includedir}/*
 
 %changelog
+* Thu Dec 03 2021 Jean-Paul Saman <jpsaman at videolan.org> - 1.3.4
+- bugfixes
+
 * Thu Aug 22 2019 Jean-Paul Saman <jpsaman at videolan.org - 1.3.3
 - bugfixes
 


=====================================
src/dvbpsi.c
=====================================
@@ -91,6 +91,7 @@ void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
     p_decoder->i_section_max_size = i_section_max_size;
     p_decoder->b_discontinuity = b_discontinuity;
     p_decoder->i_continuity_counter = DVBPSI_INVALID_CC;
+    p_decoder->prevpacket[0] = 0;
     p_decoder->p_current_section = NULL;
     p_decoder->b_current_valid = false;
 
@@ -112,6 +113,9 @@ void dvbpsi_decoder_reset(dvbpsi_decoder_t* p_decoder, const bool b_force)
     if (b_force)
         p_decoder->b_current_valid = false;
 
+    p_decoder->i_continuity_counter = DVBPSI_INVALID_CC;
+    p_decoder->prevpacket[0] = 0;
+
     /* Clear the section array */
     dvbpsi_DeletePSISections(p_decoder->p_sections);
     p_decoder->p_sections = NULL;
@@ -286,11 +290,19 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
         if (i_expected_counter == ((p_decoder->i_continuity_counter + 1) & 0xf)
             && !p_decoder->b_discontinuity)
         {
-            dvbpsi_error(p_dvbpsi, "PSI decoder",
-                     "TS duplicate (received %d, expected %d) for PID %d",
-                     p_decoder->i_continuity_counter, i_expected_counter,
-                     ((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
-            return false;
+            if(!memcmp(p_decoder->prevpacket, p_data, 188))
+            {
+                dvbpsi_debug(p_dvbpsi, "PSI decoder",
+                             "TS duplicate (received %d, expected %d) for PID %d",
+                             p_decoder->i_continuity_counter, i_expected_counter,
+                             ((uint16_t)(p_data[1] & 0x1f) << 8) | p_data[2]);
+                return false;
+            }
+            else /* Fake duplicate */
+            {
+                /* force discontinuity */
+                i_expected_counter = p_decoder->i_continuity_counter + 1;
+            }
         }
 
         if (i_expected_counter != p_decoder->i_continuity_counter)
@@ -308,6 +320,8 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
         }
     }
 
+    memcpy(p_decoder->prevpacket, p_data, 188);
+
     /* Return if no payload in the TS packet */
     if (!(p_data[3] & 0x10))
         return false;


=====================================
src/dvbpsi.h
=====================================
@@ -35,8 +35,8 @@
 #ifndef _DVBPSI_DVBPSI_H_
 #define _DVBPSI_DVBPSI_H_
 
-#define DVBPSI_VERSION      1.3.0              /*!< Human readible DVBPSI version*/
-#define DVBPSI_VERSION_INT  ((1<<16)+(3<<8)+0) /*!< Machine readible DVBPSI version */
+#define DVBPSI_VERSION      1.3.4              /*!< Human readible DVBPSI version*/
+#define DVBPSI_VERSION_INT  ((1<<16)+(3<<8)+4) /*!< Machine readible DVBPSI version */
 
 #ifdef __cplusplus
 extern "C" {
@@ -239,6 +239,7 @@ typedef void (* dvbpsi_callback_gather_t)(dvbpsi_t *p_dvbpsi,  /*!< pointer to d
     bool     b_discontinuity;      /*!< Discontinuity flag */                     \
     bool     b_current_valid;      /*!< Current valid indicator */                \
     uint8_t  i_continuity_counter; /*!< Continuity counter */                     \
+    uint8_t  prevpacket[188];      /*!< Previous packet data */                   \
     uint8_t  i_last_section_number;/*!< Last received section number */           \
     dvbpsi_psi_section_t *p_current_section; /*!< Current section */              \
     dvbpsi_psi_section_t *p_sections; /*!< List of received PSI sections */       \



View it on GitLab: https://code.videolan.org/videolan/libdvbpsi/-/compare/cb66720632efa439694c39dc3e2289d2fd113c41...7860d9e7223bc0fd378ec2fc495a1fe91109258d

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvbpsi/-/compare/cb66720632efa439694c39dc3e2289d2fd113c41...7860d9e7223bc0fd378ec2fc495a1fe91109258d
You're receiving this email because of your account on code.videolan.org.




More information about the libdvbpsi-devel mailing list