Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libdvbpsi
Commits
f5fa2246
Commit
f5fa2246
authored
May 19, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/psi.c: identation
parent
79aed10a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
src/psi.c
src/psi.c
+49
-49
No files found.
src/psi.c
View file @
f5fa2246
...
...
@@ -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
)
{
uint8_t
*
p_byte
=
p_section
->
p_data
;
/* table_id */
p_section
->
p_data
[
0
]
=
p_section
->
i_table_id
;
/* setion_syntax_indicator | private_indicator |
first 4 MSB of section_length */
p_section
->
p_data
[
1
]
=
(
p_section
->
b_syntax_indicator
?
0x80
:
0x00
)
|
(
p_section
->
b_private_indicator
?
0x40
:
0x00
)
|
0x30
/* reserved bits set to 1 */
|
((
p_section
->
i_length
>>
8
)
&
0x0f
);
/* 8 LSB of section_length */
p_section
->
p_data
[
2
]
=
p_section
->
i_length
&
0xff
;
/* Optional part of a PSI section */
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
)
uint8_t
*
p_byte
=
p_section
->
p_data
;
/* table_id */
p_section
->
p_data
[
0
]
=
p_section
->
i_table_id
;
/* setion_syntax_indicator | private_indicator |
first 4 MSB of section_length */
p_section
->
p_data
[
1
]
=
(
p_section
->
b_syntax_indicator
?
0x80
:
0x00
)
|
(
p_section
->
b_private_indicator
?
0x40
:
0x00
)
|
0x30
/* reserved bits set to 1 */
|
((
p_section
->
i_length
>>
8
)
&
0x0f
);
/* 8 LSB of section_length */
p_section
->
p_data
[
2
]
=
p_section
->
i_length
&
0xff
;
/* Optional part of a PSI section */
if
(
p_section
->
b_syntax_indicator
)
{
p_section
->
i_crc
=
(
p_section
->
i_crc
<<
8
)
^
dvbpsi_crc32_table
[(
p_section
->
i_crc
>>
24
)
^
(
*
p_byte
)];
p_byte
++
;
}
/* 8 MSB of table_id_extension */
b_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
)
^
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
[
1
]
=
(
p_section
->
i_crc
>>
16
)
&
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
[
0
]
=
(
p_section
->
i_crc
>>
24
)
&
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
[
3
]
=
p_section
->
i_crc
&
0xff
;
if
(
!
dvbpsi_ValidPSISection
(
p_section
))
{
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"
,
"* 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"
,
"********************************************"
);
if
(
!
dvbpsi_ValidPSISection
(
p_section
))
{
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"
,
"* 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"
,
"********************************************"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment