[libdvbpsi-devel] [PATCH] Fix a parsing error in dr_02.c

Daniel Kamil Kozar dkk089 at gmail.com
Sun May 31 22:03:47 CEST 2015


b_mpeg2 in dvbpsi_vstream_dr_t corresponds to what the H.222.0 refers to
as the "MPEG_1_only_flag". If the flag is not set, it means that no
extra data is contained at the end of the descriptor. The code in
dr_02.c did exactly the opposite.
---
 src/descriptors/dr_02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/descriptors/dr_02.c b/src/descriptors/dr_02.c
index 774a1c0..1c35d83 100644
--- a/src/descriptors/dr_02.c
+++ b/src/descriptors/dr_02.c
@@ -60,7 +60,7 @@ dvbpsi_vstream_dr_t * dvbpsi_DecodeVStreamDr(dvbpsi_descriptor_t * p_descriptor)
   if(!p_decoded) return NULL;
 
   /* Decode data and check the length */
-  p_decoded->b_mpeg2 = !((p_descriptor->p_data[0] & 0x04) ? true : false);
+  p_decoded->b_mpeg2 = (p_descriptor->p_data[0] & 0x04) ? true : false;
   if(    (!p_decoded->b_mpeg2 && (p_descriptor->i_length != 1))
       || (p_decoded->b_mpeg2 && (p_descriptor->i_length != 3)))
   {
-- 
2.4.2



More information about the libdvbpsi-devel mailing list