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
568874b6
Commit
568874b6
authored
Jan 23, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BAT: indentation
parent
8c9c3f19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
48 deletions
+49
-48
src/tables/bat.c
src/tables/bat.c
+49
-48
No files found.
src/tables/bat.c
View file @
568874b6
...
...
@@ -469,59 +469,60 @@ void dvbpsi_bat_sections_gather(dvbpsi_t *p_dvbpsi,
void
dvbpsi_bat_sections_decode
(
dvbpsi_bat_t
*
p_bat
,
dvbpsi_psi_section_t
*
p_section
)
{
uint8_t
*
p_byte
,
*
p_end
,
*
p_end2
;
uint8_t
*
p_byte
,
*
p_end
,
*
p_end2
;
while
(
p_section
)
{
/* - first loop descriptors */
p_byte
=
p_section
->
p_payload_start
+
2
;
p_end
=
p_byte
+
(
((
uint16_t
)(
p_section
->
p_payload_start
[
0
]
&
0x0f
)
<<
8
)
|
p_section
->
p_payload_start
[
1
]);
while
(
p_byte
+
2
<=
p_end
)
while
(
p_section
)
{
uint8_t
i_tag
=
p_byte
[
0
];
uint8_t
i_length
=
p_byte
[
1
];
if
(
i_length
+
2
<=
p_end
-
p_byte
)
dvbpsi_bat_bouquet_descriptor_add
(
p_bat
,
i_tag
,
i_length
,
p_byte
+
2
);
p_byte
+=
2
+
i_length
;
}
/* - first loop descriptors */
p_byte
=
p_section
->
p_payload_start
+
2
;
p_end
=
p_byte
+
(((
uint16_t
)(
p_section
->
p_payload_start
[
0
]
&
0x0f
)
<<
8
)
|
p_section
->
p_payload_start
[
1
]);
p_end
=
p_byte
+
(
((
uint16_t
)(
p_byte
[
0
]
&
0x0f
)
<<
8
)
|
p_byte
[
1
]);
if
(
p_end
>
p_section
->
p_payload_end
)
{
p_end
=
p_section
->
p_payload_end
;
}
while
(
p_byte
+
2
<=
p_end
)
{
uint8_t
i_tag
=
p_byte
[
0
];
uint8_t
i_length
=
p_byte
[
1
];
if
(
i_length
+
2
<=
p_end
-
p_byte
)
dvbpsi_bat_bouquet_descriptor_add
(
p_bat
,
i_tag
,
i_length
,
p_byte
+
2
);
p_byte
+=
2
+
i_length
;
}
/* - TSs */
for
(;
p_byte
+
6
<=
p_end
;)
{
p_byte
+=
2
;
uint16_t
i_ts_id
=
((
uint16_t
)
p_byte
[
0
]
<<
8
)
|
p_byte
[
1
];
uint16_t
i_orig_network_id
=
((
uint16_t
)
p_byte
[
2
]
<<
8
)
|
p_byte
[
3
];
uint16_t
i_transport_descriptors_length
=
((
uint16_t
)(
p_byte
[
4
]
&
0x0f
)
<<
8
)
|
p_byte
[
5
];
dvbpsi_bat_ts_t
*
p_ts
=
dvbpsi_bat_ts_add
(
p_bat
,
i_ts_id
,
i_orig_network_id
);
/* - TS descriptors */
p_byte
+=
6
;
p_end2
=
p_byte
+
i_transport_descriptors_length
;
if
(
p_end2
>
p_section
->
p_payload_end
)
{
p_end2
=
p_section
->
p_payload_end
;
}
while
(
p_byte
+
2
<=
p_end2
)
{
uint8_t
i_tag
=
p_byte
[
0
];
uint8_t
i_length
=
p_byte
[
1
];
if
(
i_length
+
2
<=
p_end2
-
p_byte
)
dvbpsi_bat_ts_descriptor_add
(
p_ts
,
i_tag
,
i_length
,
p_byte
+
2
);
p_byte
+=
2
+
i_length
;
}
}
p_end
=
p_byte
+
(((
uint16_t
)(
p_byte
[
0
]
&
0x0f
)
<<
8
)
|
p_byte
[
1
]);
if
(
p_end
>
p_section
->
p_payload_end
)
p_end
=
p_section
->
p_payload_end
;
/* - TSs */
while
(
p_byte
+
6
<=
p_end
)
{
p_byte
+=
2
;
uint16_t
i_ts_id
=
((
uint16_t
)
p_byte
[
0
]
<<
8
)
|
p_byte
[
1
];
uint16_t
i_orig_network_id
=
((
uint16_t
)
p_byte
[
2
]
<<
8
)
|
p_byte
[
3
];
uint16_t
i_transport_descriptors_length
=
((
uint16_t
)(
p_byte
[
4
]
&
0x0f
)
<<
8
)
|
p_byte
[
5
];
dvbpsi_bat_ts_t
*
p_ts
=
dvbpsi_bat_ts_add
(
p_bat
,
i_ts_id
,
i_orig_network_id
);
if
(
!
p_ts
)
break
;
p_section
=
p_section
->
p_next
;
}
/* - TS descriptors */
p_byte
+=
6
;
p_end2
=
p_byte
+
i_transport_descriptors_length
;
if
(
p_end2
>
p_section
->
p_payload_end
)
p_end2
=
p_section
->
p_payload_end
;
while
(
p_byte
+
2
<=
p_end2
)
{
uint8_t
i_tag
=
p_byte
[
0
];
uint8_t
i_length
=
p_byte
[
1
];
if
(
i_length
+
2
<=
p_end2
-
p_byte
)
dvbpsi_bat_ts_descriptor_add
(
p_ts
,
i_tag
,
i_length
,
p_byte
+
2
);
p_byte
+=
2
+
i_length
;
}
}
p_section
=
p_section
->
p_next
;
}
}
/*****************************************************************************
...
...
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