rpms/libdvbpsi/F-18 0001-dvbpsi_decoder_t-align-DVBPSI_DECODER_COMMON.patch, NONE, 1.1 0001-dvbpsi_decoder_t-solve-alignment-issues-with-dvbpsi_.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 libdvbpsi.spec, 1.8, 1.9 sources, 1.5, 1.6

Nicolas Chauvet kwizart at rpmfusion.org
Thu Oct 18 21:55:17 CEST 2012


Author: kwizart

Update of /cvs/free/rpms/libdvbpsi/F-18
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv12897/F-18

Modified Files:
	.cvsignore libdvbpsi.spec sources 
Added Files:
	0001-dvbpsi_decoder_t-align-DVBPSI_DECODER_COMMON.patch 
	0001-dvbpsi_decoder_t-solve-alignment-issues-with-dvbpsi_.patch 
Log Message:
Update to 1.0.0-pre3


0001-dvbpsi_decoder_t-align-DVBPSI_DECODER_COMMON.patch:
 dvbpsi.h             |   11 ++++++-----
 tables/nit_private.h |    4 ++--
 tables/pmt_private.h |    5 ++---
 3 files changed, 10 insertions(+), 10 deletions(-)

--- NEW FILE 0001-dvbpsi_decoder_t-align-DVBPSI_DECODER_COMMON.patch ---
>From 259e2a12fafe4c09ea3265fd686f308db4c31a60 Mon Sep 17 00:00:00 2001
From: Jean-Paul Saman <jpsaman at videolan.org>
Date: Tue, 16 Oct 2012 10:56:26 +0200
Subject: [PATCH] dvbpsi_decoder_t: align DVBPSI_DECODER_COMMON

---
 src/dvbpsi.h             | 11 ++++++-----
 src/tables/nit_private.h |  4 ++--
 src/tables/pmt_private.h |  4 ++--
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/dvbpsi.h b/src/dvbpsi.h
index 3118da8..f373103 100644
--- a/src/dvbpsi.h
+++ b/src/dvbpsi.h
@@ -197,16 +197,17 @@ typedef void (* dvbpsi_callback_gather_t)(dvbpsi_t *p_dvbpsi,  /*!< pointer to d
  * decoder.
  */
 #define DVBPSI_DECODER_COMMON                                                     \
-    dvbpsi_callback_gather_t  pf_gather;/*!< PSI decoder's callback */            \
-    int      i_section_max_size;   /*!< Max size of a section for this decoder */ \
-    uint8_t  i_continuity_counter; /*!< Continuity counter */                     \
     bool     b_discontinuity;      /*!< Discontinuity flag */                     \
-    dvbpsi_psi_section_t *p_current_section; /*!< Current section */              \
     bool     b_current_valid;      /*!< Current valid indicator */                \
+    uint8_t  i_continuity_counter; /*!< Continuity counter */                     \
     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 */       \
+    dvbpsi_callback_gather_t  pf_gather;/*!< PSI decoder's callback */            \
+    int      i_section_max_size;   /*!< Max size of a section for this decoder */ \
     int      i_need;               /*!< Bytes needed */                           \
-    bool     b_complete_header;    /*!< Flag for header completion */
+    bool     b_complete_header;    /*!< Flag for header completion */             \
+    uint8_t  i_reserved[3];        /*!< Reserved */
 
 struct dvbpsi_decoder_s
 {
diff --git a/src/tables/nit_private.h b/src/tables/nit_private.h
index 8eadce7..6c80e35 100644
--- a/src/tables/nit_private.h
+++ b/src/tables/nit_private.h
@@ -39,14 +39,14 @@ typedef struct dvbpsi_nit_decoder_s
 {
     DVBPSI_DECODER_COMMON
 
-    uint16_t                      i_network_id;
-
     dvbpsi_nit_callback           pf_nit_callback;
     void *                        p_cb_data;
 
     dvbpsi_nit_t                  current_nit;
     dvbpsi_nit_t *                p_building_nit;
 
+    uint16_t                      i_network_id;
+
 } dvbpsi_nit_decoder_t;
 
 /*****************************************************************************
diff --git a/src/tables/pmt_private.h b/src/tables/pmt_private.h
index ed75a8b..4f10ecc 100644
--- a/src/tables/pmt_private.h
+++ b/src/tables/pmt_private.h
@@ -37,14 +37,14 @@ typedef struct dvbpsi_pmt_decoder_s
 {
     DVBPSI_DECODER_COMMON
 
-    uint16_t                      i_program_number;
-
     dvbpsi_pmt_callback           pf_pmt_callback;
     void *                        p_cb_data;
 
     dvbpsi_pmt_t                  current_pmt;
     dvbpsi_pmt_t *                p_building_pmt;
 
+    uint16_t                      i_program_number;
+
 } dvbpsi_pmt_decoder_t;
 
 /*****************************************************************************
-- 
1.7.11.7


0001-dvbpsi_decoder_t-solve-alignment-issues-with-dvbpsi_.patch:
 dvbpsi.c             |    3 +
 dvbpsi.h             |   82 +++++++++++++++++++++++++++++++++++++--------------
 tables/nit_private.h |    4 +-
 tables/pmt_private.h |    5 +--
 4 files changed, 66 insertions(+), 28 deletions(-)

--- NEW FILE 0001-dvbpsi_decoder_t-solve-alignment-issues-with-dvbpsi_.patch ---
>From 9d20b904c0649cae0c71cef5177113821dfcc71f Mon Sep 17 00:00:00 2001
From: Jean-Paul Saman <jpsaman at videolan.org>
Date: Tue, 16 Oct 2012 10:56:26 +0200
Subject: [PATCH] dvbpsi_decoder_t: solve alignment issues with
 dvbpsi_decoder_t casting.

Repack DVBPSI_DECODER_COMMON to be byte aligned and add some checks to
do clever casting.
---
 src/dvbpsi.c             |  3 +-
 src/dvbpsi.h             | 82 +++++++++++++++++++++++++++++++++++-------------
 src/tables/nit_private.h |  4 +--
 src/tables/pmt_private.h |  4 +--
 4 files changed, 66 insertions(+), 27 deletions(-)

diff --git a/src/dvbpsi.c b/src/dvbpsi.c
index ffbfaca..d45802e 100644
--- a/src/dvbpsi.c
+++ b/src/dvbpsi.c
@@ -170,7 +170,7 @@ void dvbpsi_delete(dvbpsi_t *p_dvbpsi)
  * dvbpsi_decoder_new
  *****************************************************************************/
 #define DVBPSI_INVALID_CC (0xFF)
-dvbpsi_decoder_t *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
+void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
     const int i_section_max_size, const bool b_discontinuity, const size_t psi_size)
 {
     assert(psi_size >= sizeof(dvbpsi_decoder_t));
@@ -179,6 +179,7 @@ dvbpsi_decoder_t *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
     if (p_decoder == NULL)
         return NULL;
 
+    memcpy(&p_decoder->i_magic[0], "psi", 3);
     p_decoder->pf_gather = pf_gather;
     p_decoder->p_current_section = NULL;
     p_decoder->i_section_max_size = i_section_max_size;
diff --git a/src/dvbpsi.h b/src/dvbpsi.h
index 3118da8..8a019e3 100644
--- a/src/dvbpsi.h
+++ b/src/dvbpsi.h
@@ -43,6 +43,16 @@ extern "C" {
 #endif
 
 /*****************************************************************************
+ * Helper for GCC version checks borrowed from VLC.
+ *****************************************************************************/
+#ifdef __GNUC__
+# define DVBPSI_GCC_VERSION(maj,min) \
+    ((__GNUC__ > (maj)) || (__GNUC__ == (maj) && __GNUC_MINOR__ >= (min)))
+#else
+# define DVBPSI_GCC_VERSION(maj,min) (0)
+#endif
+
+/*****************************************************************************
  * dvbpsi_t
  *****************************************************************************/
 /*!
@@ -90,7 +100,22 @@ typedef struct dvbpsi_decoder_s dvbpsi_decoder_t;
  * \def DVBPSI_DECODER(x)
  * \brief Helper macro for casting a private decoder into a dvbpsi_decoder_t
  */
-#define DVBPSI_DECODER(x) ((dvbpsi_decoder_t *)(x))
+/* Clever cast borrowed from VLC */
+#if DVBPSI_GCC_VERSION(4,0)
+# ifndef __cplusplus
+#  define DVBPSI_DECODER( x ) \
+    __builtin_choose_expr( \
+        __builtin_offsetof(__typeof__(*(x)), i_magic), \
+        (void)0, \
+        (dvbpsi_decoder_t *)(x))
+# else
+#  define DVBPSI_DECODER( x ) \
+    ((dvbpsi_decoder_t *)(x) \
+      + 0 * __builtin_offsetof(__typeof__(*(x)), i_magic))
+# endif
+#else
+# define DVBPSI_DECODER(x) ((dvbpsi_decoder_t *)(x))
+#endif
 
 /*****************************************************************************
  * dvbpsi_t
@@ -187,6 +212,28 @@ typedef void (* dvbpsi_callback_gather_t)(dvbpsi_t *p_dvbpsi,  /*!< pointer to d
                             dvbpsi_psi_section_t* p_section);  /*!< pointer to psi section */
 
 /*****************************************************************************
+ * DVBPSI_DECODER_COMMON
+ *****************************************************************************/
+#define DVBPSI_DECODER_COMMON                                                     \
+/*!                                                                               \
+ * \name DVBPSI_DECODER_COMMON                                                    \
+ * these members are common for all dvbpsi_decoder_t                              \
+ */                                                                               \
+/**@{*/                                                                           \
+    uint8_t  i_magic[3];           /*!< Reserved magic value */                   \
+    bool     b_complete_header;    /*!< Flag for header completion */             \
+    bool     b_discontinuity;      /*!< Discontinuity flag */                     \
+    bool     b_current_valid;      /*!< Current valid indicator */                \
+    uint8_t  i_continuity_counter; /*!< Continuity counter */                     \
+    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 */       \
+    dvbpsi_callback_gather_t  pf_gather;/*!< PSI decoder's callback */            \
+    int      i_section_max_size;   /*!< Max size of a section for this decoder */ \
+    int      i_need;               /*!< Bytes needed */                           \
+/**@}*/
+
+/*****************************************************************************
  * struct dvbpsi_decoder_s
  *****************************************************************************/
 /*!
@@ -196,18 +243,6 @@ typedef void (* dvbpsi_callback_gather_t)(dvbpsi_t *p_dvbpsi,  /*!< pointer to d
  * This structure shouldn't be used but if you want to write an external
  * decoder.
  */
-#define DVBPSI_DECODER_COMMON                                                     \
-    dvbpsi_callback_gather_t  pf_gather;/*!< PSI decoder's callback */            \
-    int      i_section_max_size;   /*!< Max size of a section for this decoder */ \
-    uint8_t  i_continuity_counter; /*!< Continuity counter */                     \
-    bool     b_discontinuity;      /*!< Discontinuity flag */                     \
-    dvbpsi_psi_section_t *p_current_section; /*!< Current section */              \
-    bool     b_current_valid;      /*!< Current valid indicator */                \
-    uint8_t  i_last_section_number;/*!< Last received section number */           \
-    dvbpsi_psi_section_t *p_sections; /*!< List of received PSI sections */       \
-    int      i_need;               /*!< Bytes needed */                           \
-    bool     b_complete_header;    /*!< Flag for header completion */
-
 struct dvbpsi_decoder_s
 {
     DVBPSI_DECODER_COMMON
@@ -217,22 +252,25 @@ struct dvbpsi_decoder_s
  * dvbpsi_decoder_new
  *****************************************************************************/
 /*!
- * \fn dvbpsi_decoder_t *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
+ * \fn void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
  *     const int i_section_max_size, const bool b_discontinuity, const size_t psi_size);
- * \brief Create a new dvbpsi_decoder_t.
+ * \brief Create a new (private) dvbpsi decoder.
  * \param pf_gather pointer to gather function for PSI decoder.
  * \param i_section_max_size Max size of a section for this decoder
  * \param b_discontinuity Discontinuity flag
  * \param psi_size size of new PSI struct, eg: sizeof(dvbpsi_pat_t)
- * \return pointer to dvbpsi_decoder_t
+ * \return pointer to memory of size 'psi_size' that can be casted into a dvbpsi_decoder_t.
  *
- * Creates a dvbpsi_decoder_t pointer to struct dvbpsi_decoder_s. It should be
- * delete with @see dvbpsi_decoder_delete() function.
+ * Creates a void pointer that points to a private dvbpsi decoder struct (eg: dvbpsi_pat_t).
+ * The first elements in this newly created decoder should contain DVBPSI_DECODER_COMMON, which
+ * corresponds to a dvbpsi_decoder_t.
+ * Upon return the pointer should be casted to the correct type. Delete the pointer
+ * with @see dvbpsi_decoder_delete() function.
  */
-dvbpsi_decoder_t *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
-                                    const int i_section_max_size,
-                                    const bool b_discontinuity,
-                                    const size_t psi_size);
+void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
+                         const int i_section_max_size,
+                         const bool b_discontinuity,
+                         const size_t psi_size);
 
 /*****************************************************************************
  * dvbpsi_decoder_delete
diff --git a/src/tables/nit_private.h b/src/tables/nit_private.h
index 8eadce7..6c80e35 100644
--- a/src/tables/nit_private.h
+++ b/src/tables/nit_private.h
@@ -39,14 +39,14 @@ typedef struct dvbpsi_nit_decoder_s
 {
     DVBPSI_DECODER_COMMON
 
-    uint16_t                      i_network_id;
-
     dvbpsi_nit_callback           pf_nit_callback;
     void *                        p_cb_data;
 
     dvbpsi_nit_t                  current_nit;
     dvbpsi_nit_t *                p_building_nit;
 
+    uint16_t                      i_network_id;
+
 } dvbpsi_nit_decoder_t;
 
 /*****************************************************************************
diff --git a/src/tables/pmt_private.h b/src/tables/pmt_private.h
index ed75a8b..4f10ecc 100644
--- a/src/tables/pmt_private.h
+++ b/src/tables/pmt_private.h
@@ -37,14 +37,14 @@ typedef struct dvbpsi_pmt_decoder_s
 {
     DVBPSI_DECODER_COMMON
 
-    uint16_t                      i_program_number;
-
     dvbpsi_pmt_callback           pf_pmt_callback;
     void *                        p_cb_data;
 
     dvbpsi_pmt_t                  current_pmt;
     dvbpsi_pmt_t *                p_building_pmt;
 
+    uint16_t                      i_program_number;
+
 } dvbpsi_pmt_decoder_t;
 
 /*****************************************************************************
-- 
1.7.11.7



Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/libdvbpsi/F-18/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- .cvsignore	4 Nov 2011 23:16:16 -0000	1.5
+++ .cvsignore	18 Oct 2012 19:55:16 -0000	1.6
@@ -1 +1 @@
-libdvbpsi-0.2.2.tar.bz2
+libdvbpsi-1.0.0_pre3.tar.bz2


Index: libdvbpsi.spec
===================================================================
RCS file: /cvs/free/rpms/libdvbpsi/F-18/libdvbpsi.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- libdvbpsi.spec	25 Jan 2012 14:50:19 -0000	1.8
+++ libdvbpsi.spec	18 Oct 2012 19:55:17 -0000	1.9
@@ -1,11 +1,16 @@
+%global pre _pre3
+%global _default_patch_fuzz 2
+
 Summary: 	Library for MPEG TS and DVB PSI tables decoding and generation
 Name: 		libdvbpsi
-Version: 	0.2.2
-Release: 	2%{?dist}
+Version: 	1.0.0
+Release: 	0.1%{?pre}%{?dist}
 License: 	LGPLv2+
 Group: 		System Environment/Libraries
 URL: 		http://www.videolan.org/developers/libdvbpsi.html
-Source0: 	http://download.videolan.org/pub/libdvbpsi/%{version}/%{name}-%{version}.tar.bz2
+Source0: 	http://download.videolan.org/pub/libdvbpsi/%{version}/%{name}-%{version}%{?pre}.tar.bz2
+Patch0:         0001-dvbpsi_decoder_t-align-DVBPSI_DECODER_COMMON.patch
+Patch1:         0001-dvbpsi_decoder_t-solve-alignment-issues-with-dvbpsi_.patch
 BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	graphviz doxygen
 
@@ -28,8 +33,9 @@
 # -----------------------------------------------------------------------------
 
 %prep
-%setup -q
-
+%setup -q -n %{name}-%{version}%{?pre}
+#patch0 -p1
+%patch1 -p1
 
 
 # -----------------------------------------------------------------------------
@@ -71,6 +77,9 @@
 # -----------------------------------------------------------------------------
 
 %changelog
+* Sat Oct 06 2012 Nicolas Chauvet <kwizart at gmail.com> - 1.0.0-0.1_pre2
+- Update to 1.0.0_pre2
+
 * Wed Jan 25 2012 Nicolas Chauvet <kwizart at gmail.com> - 0.2.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/free/rpms/libdvbpsi/F-18/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sources	4 Nov 2011 23:16:17 -0000	1.5
+++ sources	18 Oct 2012 19:55:17 -0000	1.6
@@ -1 +1 @@
-b387e07ffd844b61c7a050c47307c0f7  libdvbpsi-0.2.2.tar.bz2
+58ee643c11c0da05e616d6876f849547  libdvbpsi-1.0.0_pre3.tar.bz2


More information about the rpmfusion-commits mailing list