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
4ce2b8c3
Commit
4ce2b8c3
authored
Jun 24, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/tables/pat.c: Cleanup indentation
parent
c932b126
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
76 deletions
+75
-76
src/tables/pat.c
src/tables/pat.c
+75
-76
No files found.
src/tables/pat.c
View file @
4ce2b8c3
...
...
@@ -358,22 +358,21 @@ void dvbpsi_GatherPATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_sectio
void
dvbpsi_DecodePATSections
(
dvbpsi_pat_t
*
p_pat
,
dvbpsi_psi_section_t
*
p_section
)
{
while
(
p_section
)
{
for
(
uint8_t
*
p_byte
=
p_section
->
p_payload_start
;
p_byte
<
p_section
->
p_payload_end
;
p_byte
+=
4
)
while
(
p_section
)
{
uint16_t
i_program_number
=
((
uint16_t
)(
p_byte
[
0
])
<<
8
)
|
p_byte
[
1
];
uint16_t
i_pid
=
((
uint16_t
)(
p_byte
[
2
]
&
0x1f
)
<<
8
)
|
p_byte
[
3
];
dvbpsi_PATAddProgram
(
p_pat
,
i_program_number
,
i_pid
);
}
for
(
uint8_t
*
p_byte
=
p_section
->
p_payload_start
;
p_byte
<
p_section
->
p_payload_end
;
p_byte
+=
4
)
{
uint16_t
i_program_number
=
((
uint16_t
)(
p_byte
[
0
])
<<
8
)
|
p_byte
[
1
];
uint16_t
i_pid
=
((
uint16_t
)(
p_byte
[
2
]
&
0x1f
)
<<
8
)
|
p_byte
[
3
];
dvbpsi_PATAddProgram
(
p_pat
,
i_program_number
,
i_pid
);
}
p_section
=
p_section
->
p_next
;
}
p_section
=
p_section
->
p_next
;
}
}
/*****************************************************************************
* dvbpsi_GenPATSections
*****************************************************************************
...
...
@@ -383,71 +382,71 @@ void dvbpsi_DecodePATSections(dvbpsi_pat_t* p_pat,
dvbpsi_psi_section_t
*
dvbpsi_GenPATSections
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_pat_t
*
p_pat
,
int
i_max_pps
)
{
dvbpsi_psi_section_t
*
p_result
=
dvbpsi_NewPSISection
(
1024
);
dvbpsi_psi_section_t
*
p_current
=
p_result
;
dvbpsi_psi_section_t
*
p_prev
;
dvbpsi_pat_program_t
*
p_program
=
p_pat
->
p_first_program
;
int
i_count
=
0
;
/* A PAT section can carry up to 253 programs */
if
((
i_max_pps
<=
0
)
||
(
i_max_pps
>
253
))
i_max_pps
=
253
;
p_current
->
i_table_id
=
0
;
p_current
->
b_syntax_indicator
=
true
;
p_current
->
b_private_indicator
=
false
;
p_current
->
i_length
=
9
;
/* header + CRC_32 */
p_current
->
i_extension
=
p_pat
->
i_ts_id
;
p_current
->
i_version
=
p_pat
->
i_version
;
p_current
->
b_current_next
=
p_pat
->
b_current_next
;
p_current
->
i_number
=
0
;
p_current
->
p_payload_end
+=
8
;
/* just after the header */
p_current
->
p_payload_start
=
p_current
->
p_payload_end
;
/* PAT programs */
while
(
p_program
!=
NULL
)
{
/* New section if needed */
if
(
++
i_count
>
i_max_pps
)
dvbpsi_psi_section_t
*
p_result
=
dvbpsi_NewPSISection
(
1024
);
dvbpsi_psi_section_t
*
p_current
=
p_result
;
dvbpsi_psi_section_t
*
p_prev
;
dvbpsi_pat_program_t
*
p_program
=
p_pat
->
p_first_program
;
int
i_count
=
0
;
/* A PAT section can carry up to 253 programs */
if
((
i_max_pps
<=
0
)
||
(
i_max_pps
>
253
))
i_max_pps
=
253
;
p_current
->
i_table_id
=
0
;
p_current
->
b_syntax_indicator
=
true
;
p_current
->
b_private_indicator
=
false
;
p_current
->
i_length
=
9
;
/* header + CRC_32 */
p_current
->
i_extension
=
p_pat
->
i_ts_id
;
p_current
->
i_version
=
p_pat
->
i_version
;
p_current
->
b_current_next
=
p_pat
->
b_current_next
;
p_current
->
i_number
=
0
;
p_current
->
p_payload_end
+=
8
;
/* just after the header */
p_current
->
p_payload_start
=
p_current
->
p_payload_end
;
/* PAT programs */
while
(
p_program
!=
NULL
)
{
/* New section if needed */
if
(
++
i_count
>
i_max_pps
)
{
p_prev
=
p_current
;
p_current
=
dvbpsi_NewPSISection
(
1024
);
p_prev
->
p_next
=
p_current
;
i_count
=
1
;
p_current
->
i_table_id
=
0
;
p_current
->
b_syntax_indicator
=
true
;
p_current
->
b_private_indicator
=
false
;
p_current
->
i_length
=
9
;
/* header + CRC_32 */
p_current
->
i_extension
=
p_pat
->
i_ts_id
;
p_current
->
i_version
=
p_pat
->
i_version
;
p_current
->
b_current_next
=
p_pat
->
b_current_next
;
p_current
->
i_number
=
p_prev
->
i_number
+
1
;
p_current
->
p_payload_end
+=
8
;
/* just after the header */
p_current
->
p_payload_start
=
p_current
->
p_payload_end
;
}
/* p_payload_end is where the program begins */
p_current
->
p_payload_end
[
0
]
=
p_program
->
i_number
>>
8
;
p_current
->
p_payload_end
[
1
]
=
p_program
->
i_number
;
p_current
->
p_payload_end
[
2
]
=
(
p_program
->
i_pid
>>
8
)
|
0xe0
;
p_current
->
p_payload_end
[
3
]
=
p_program
->
i_pid
;
/* Increase length by 4 */
p_current
->
p_payload_end
+=
4
;
p_current
->
i_length
+=
4
;
p_program
=
p_program
->
p_next
;
}
/* Finalization */
p_prev
=
p_result
;
while
(
p_prev
!=
NULL
)
{
p_prev
=
p_current
;
p_current
=
dvbpsi_NewPSISection
(
1024
);
p_prev
->
p_next
=
p_current
;
i_count
=
1
;
p_current
->
i_table_id
=
0
;
p_current
->
b_syntax_indicator
=
true
;
p_current
->
b_private_indicator
=
false
;
p_current
->
i_length
=
9
;
/* header + CRC_32 */
p_current
->
i_extension
=
p_pat
->
i_ts_id
;
p_current
->
i_version
=
p_pat
->
i_version
;
p_current
->
b_current_next
=
p_pat
->
b_current_next
;
p_current
->
i_number
=
p_prev
->
i_number
+
1
;
p_current
->
p_payload_end
+=
8
;
/* just after the header */
p_current
->
p_payload_start
=
p_current
->
p_payload_end
;
p_prev
->
i_last_number
=
p_current
->
i_number
;
dvbpsi_BuildPSISection
(
p_dvbpsi
,
p_prev
);
p_prev
=
p_prev
->
p_next
;
}
/* p_payload_end is where the program begins */
p_current
->
p_payload_end
[
0
]
=
p_program
->
i_number
>>
8
;
p_current
->
p_payload_end
[
1
]
=
p_program
->
i_number
;
p_current
->
p_payload_end
[
2
]
=
(
p_program
->
i_pid
>>
8
)
|
0xe0
;
p_current
->
p_payload_end
[
3
]
=
p_program
->
i_pid
;
/* Increase length by 4 */
p_current
->
p_payload_end
+=
4
;
p_current
->
i_length
+=
4
;
p_program
=
p_program
->
p_next
;
}
/* Finalization */
p_prev
=
p_result
;
while
(
p_prev
!=
NULL
)
{
p_prev
->
i_last_number
=
p_current
->
i_number
;
dvbpsi_BuildPSISection
(
p_dvbpsi
,
p_prev
);
p_prev
=
p_prev
->
p_next
;
}
return
p_result
;
return
p_result
;
}
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