Browse Source

Make ts_section_is_same() stricter

Georgi Chorbadzhiyski 9 years ago
parent
commit
717d1e9c22
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      tsfuncs_sections.c

+ 9
- 2
tsfuncs_sections.c View File

@@ -77,16 +77,23 @@ void ts_section_header_generate(uint8_t *ts_packet, struct ts_section_header *ts
77 77
 }
78 78
 
79 79
 int ts_section_is_same(struct ts_section_header *s1, struct ts_section_header *s2) {
80
-	if (s1->CRC != s2->CRC)
80
+//	ts_LOGf("s1->table_id=%d s2->table_id=%d\n", s1->table_id, s2->table_id);
81
+	if (s1->table_id != s2->table_id)
81 82
 		return 0;
82 83
 
84
+//	ts_LOGf("s1->version_number=%d s2->version_number=%d\n", s1->version_number, s2->version_number);
83 85
 	if (s1->version_number != s2->version_number)
84 86
 		return 0;
85 87
 
88
+//	ts_LOGf("s1->section_number=%d s2->section_number=%d\n", s1->section_number, s2->section_number);
86 89
 	if (s1->section_number != s2->section_number)
87 90
 		return 0;
88 91
 
89
-	return 1; // Should be the same
92
+//	ts_LOGf("s1->section_length=%d s2->section_length=%d\n", s1->section_number, s2->section_number);
93
+	if (s1->section_length != s2->section_length)
94
+		return 0;
95
+
96
+	return memcmp(s1->section_data, s2->section_data, s1->section_length) == 0;
90 97
 }
91 98
 
92 99
 #define IN(x, a, b) \

Loading…
Cancel
Save