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
89f23e87
Commit
89f23e87
authored
Aug 07, 2018
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
really identify duplicates
parent
311cd26e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
src/dvbpsi.c
src/dvbpsi.c
+16
-5
src/dvbpsi.h
src/dvbpsi.h
+1
-0
No files found.
src/dvbpsi.c
View file @
89f23e87
...
@@ -98,6 +98,7 @@ void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
...
@@ -98,6 +98,7 @@ void *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
p_decoder
->
i_section_max_size
=
i_section_max_size
;
p_decoder
->
i_section_max_size
=
i_section_max_size
;
p_decoder
->
b_discontinuity
=
b_discontinuity
;
p_decoder
->
b_discontinuity
=
b_discontinuity
;
p_decoder
->
i_continuity_counter
=
DVBPSI_INVALID_CC
;
p_decoder
->
i_continuity_counter
=
DVBPSI_INVALID_CC
;
p_decoder
->
prevpacket
[
0
]
=
0
;
p_decoder
->
p_current_section
=
NULL
;
p_decoder
->
p_current_section
=
NULL
;
p_decoder
->
b_current_valid
=
false
;
p_decoder
->
b_current_valid
=
false
;
...
@@ -293,12 +294,20 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
...
@@ -293,12 +294,20 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
if
(
i_expected_counter
==
((
p_decoder
->
i_continuity_counter
+
1
)
&
0xf
)
if
(
i_expected_counter
==
((
p_decoder
->
i_continuity_counter
+
1
)
&
0xf
)
&&
!
p_decoder
->
b_discontinuity
)
&&
!
p_decoder
->
b_discontinuity
)
{
{
dvbpsi_error
(
p_dvbpsi
,
"PSI decoder"
,
if
(
!
memcmp
(
p_decoder
->
prevpacket
,
p_data
,
188
))
{
dvbpsi_debug
(
p_dvbpsi
,
"PSI decoder"
,
"TS duplicate (received %d, expected %d) for PID %d"
,
"TS duplicate (received %d, expected %d) for PID %d"
,
p_decoder
->
i_continuity_counter
,
i_expected_counter
,
p_decoder
->
i_continuity_counter
,
i_expected_counter
,
((
uint16_t
)(
p_data
[
1
]
&
0x1f
)
<<
8
)
|
p_data
[
2
]);
((
uint16_t
)(
p_data
[
1
]
&
0x1f
)
<<
8
)
|
p_data
[
2
]);
return
false
;
return
false
;
}
}
else
/* Fake duplicate */
{
/* force discontinuity */
i_expected_counter
=
p_decoder
->
i_continuity_counter
+
1
;
}
}
if
(
i_expected_counter
!=
p_decoder
->
i_continuity_counter
)
if
(
i_expected_counter
!=
p_decoder
->
i_continuity_counter
)
{
{
...
@@ -315,6 +324,8 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
...
@@ -315,6 +324,8 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, const uint8_t* p_data)
}
}
}
}
memcpy
(
p_decoder
->
prevpacket
,
p_data
,
188
);
/* Return if no payload in the TS packet */
/* Return if no payload in the TS packet */
if
(
!
(
p_data
[
3
]
&
0x10
))
if
(
!
(
p_data
[
3
]
&
0x10
))
return
false
;
return
false
;
...
...
src/dvbpsi.h
View file @
89f23e87
...
@@ -264,6 +264,7 @@ typedef void (*dvbpsi_callback_del_t)(dvbpsi_t *p_dvbpsi, /*!< pointer to dvbp
...
@@ -264,6 +264,7 @@ typedef void (*dvbpsi_callback_del_t)(dvbpsi_t *p_dvbpsi, /*!< pointer to dvbp
bool b_discontinuity;
/*!< Discontinuity flag */
\
bool b_discontinuity;
/*!< Discontinuity flag */
\
bool b_current_valid;
/*!< Current valid indicator */
\
bool b_current_valid;
/*!< Current valid indicator */
\
uint8_t i_continuity_counter;
/*!< Continuity counter */
\
uint8_t i_continuity_counter;
/*!< Continuity counter */
\
uint8_t prevpacket[188];
/*!< Previous packet data */
\
uint8_t i_last_section_number;
/*!< Last received section number */
\
uint8_t i_last_section_number;
/*!< Last received section number */
\
dvbpsi_psi_section_t *p_current_section;
/*!< Current section */
\
dvbpsi_psi_section_t *p_current_section;
/*!< Current section */
\
dvbpsi_psi_section_t *p_sections;
/*!< List of received PSI sections */
\
dvbpsi_psi_section_t *p_sections;
/*!< List of received PSI sections */
\
...
...
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