Commit f5fa2246 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/psi.c: identation

parent 79aed10a
...@@ -124,57 +124,57 @@ bool dvbpsi_ValidPSISection(dvbpsi_psi_section_t* p_section) ...@@ -124,57 +124,57 @@ bool dvbpsi_ValidPSISection(dvbpsi_psi_section_t* p_section)
*****************************************************************************/ *****************************************************************************/
void dvbpsi_BuildPSISection(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_section) void dvbpsi_BuildPSISection(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_section)
{ {
uint8_t* p_byte = p_section->p_data; uint8_t* p_byte = p_section->p_data;
/* table_id */ /* table_id */
p_section->p_data[0] = p_section->i_table_id; p_section->p_data[0] = p_section->i_table_id;
/* setion_syntax_indicator | private_indicator | /* setion_syntax_indicator | private_indicator |
first 4 MSB of section_length */ first 4 MSB of section_length */
p_section->p_data[1] = (p_section->b_syntax_indicator ? 0x80 : 0x00) p_section->p_data[1] = (p_section->b_syntax_indicator ? 0x80 : 0x00)
| (p_section->b_private_indicator ? 0x40 : 0x00) | (p_section->b_private_indicator ? 0x40 : 0x00)
| 0x30 /* reserved bits set to 1 */ | 0x30 /* reserved bits set to 1 */
| ((p_section->i_length >> 8) & 0x0f); | ((p_section->i_length >> 8) & 0x0f);
/* 8 LSB of section_length */ /* 8 LSB of section_length */
p_section->p_data[2] = p_section->i_length & 0xff; p_section->p_data[2] = p_section->i_length & 0xff;
/* Optional part of a PSI section */ /* Optional part of a PSI section */
if (p_section->b_syntax_indicator) if (p_section->b_syntax_indicator)
{
/* 8 MSB of table_id_extension */
p_section->p_data[3] = (p_section->i_extension >> 8) & 0xff;
/* 8 LSB of table_id_extension */
p_section->p_data[4] = p_section->i_extension & 0xff;
/* 5 bits of version_number | current_next_indicator */
p_section->p_data[5] = 0xc0 /* reserved bits set to 1 */
| ((p_section->i_version & 0x1f) << 1)
| (p_section->b_current_next ? 0x01 : 0x00);
/* section_number */
p_section->p_data[6] = p_section->i_number;
/* last_section_number */
p_section->p_data[7] = p_section->i_last_number;
/* CRC_32 */
p_section->i_crc = 0xffffffff;
while (p_byte < p_section->p_payload_end)
{ {
p_section->i_crc = (p_section->i_crc << 8) /* 8 MSB of table_id_extension */
^ dvbpsi_crc32_table[(p_section->i_crc >> 24) ^ (*p_byte)]; b_section->p_data[3] = (p_section->i_extension >> 8) & 0xff;
p_byte++; /* 8 LSB of table_id_extension */
} p_section->p_data[4] = p_section->i_extension & 0xff;
/* 5 bits of version_number | current_next_indicator */
p_section->p_data[5] = 0xc0 /* reserved bits set to 1 */
| ((p_section->i_version & 0x1f) << 1)
| (p_section->b_current_next ? 0x01 : 0x00);
/* section_number */
p_section->p_data[6] = p_section->i_number;
/* last_section_number */
p_section->p_data[7] = p_section->i_last_number;
/* CRC_32 */
p_section->i_crc = 0xffffffff;
while (p_byte < p_section->p_payload_end)
{
p_section->i_crc = (p_section->i_crc << 8)
^ dvbpsi_crc32_table[(p_section->i_crc >> 24) ^ (*p_byte)];
p_byte++;
}
p_section->p_payload_end[0] = (p_section->i_crc >> 24) & 0xff; p_section->p_payload_end[0] = (p_section->i_crc >> 24) & 0xff;
p_section->p_payload_end[1] = (p_section->i_crc >> 16) & 0xff; p_section->p_payload_end[1] = (p_section->i_crc >> 16) & 0xff;
p_section->p_payload_end[2] = (p_section->i_crc >> 8) & 0xff; p_section->p_payload_end[2] = (p_section->i_crc >> 8) & 0xff;
p_section->p_payload_end[3] = p_section->i_crc & 0xff; p_section->p_payload_end[3] = p_section->i_crc & 0xff;
if (!dvbpsi_ValidPSISection(p_section)) if (!dvbpsi_ValidPSISection(p_section))
{ {
dvbpsi_error(p_dvbpsi, "misc PSI", "********************************************"); dvbpsi_error(p_dvbpsi, "misc PSI", "********************************************");
dvbpsi_error(p_dvbpsi, "misc PSI", "* Generated PSI section has a bad CRC_32. *"); dvbpsi_error(p_dvbpsi, "misc PSI", "* Generated PSI section has a bad CRC_32. *");
dvbpsi_error(p_dvbpsi, "misc PSI", "* THIS IS A BUG, PLEASE REPORT TO THE LIST *"); dvbpsi_error(p_dvbpsi, "misc PSI", "* THIS IS A BUG, PLEASE REPORT TO THE LIST *");
dvbpsi_error(p_dvbpsi, "misc PSI", "* --- libdvbpsi-devel@videolan.org --- *"); dvbpsi_error(p_dvbpsi, "misc PSI", "* --- libdvbpsi-devel@videolan.org --- *");
dvbpsi_error(p_dvbpsi, "misc PSI", "********************************************"); dvbpsi_error(p_dvbpsi, "misc PSI", "********************************************");
}
} }
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment