Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dvblast
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
dvblast
Commits
785aaba1
Commit
785aaba1
authored
Nov 15, 2009
by
Marian Ďurkovič
Committed by
Christophe Massiot
Nov 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* demux.c: Fix CAPMT update when changing SID.
parent
d34f9f8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
26 deletions
+43
-26
demux.c
demux.c
+43
-26
No files found.
demux.c
View file @
785aaba1
...
@@ -316,7 +316,8 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -316,7 +316,8 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
uint16_t
*
pi_wanted_pids
,
*
pi_current_pids
;
uint16_t
*
pi_wanted_pids
,
*
pi_current_pids
;
int
i_nb_wanted_pids
,
i_nb_current_pids
;
int
i_nb_wanted_pids
,
i_nb_current_pids
;
uint16_t
i_old_sid
=
p_output
->
i_sid
;
uint16_t
i_old_sid
=
p_output
->
i_sid
;
int
b_change
=
0
;
int
sid_change
=
(
i_sid
!=
i_old_sid
);
int
pid_change
=
0
;
if
(
i_sid
==
p_output
->
i_sid
&&
i_nb_pids
==
p_output
->
i_nb_pids
&&
if
(
i_sid
==
p_output
->
i_sid
&&
i_nb_pids
==
p_output
->
i_nb_pids
&&
(
!
i_nb_pids
||
(
!
i_nb_pids
||
...
@@ -327,7 +328,7 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -327,7 +328,7 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
GetPIDS
(
&
pi_current_pids
,
&
i_nb_current_pids
,
p_output
->
i_sid
,
GetPIDS
(
&
pi_current_pids
,
&
i_nb_current_pids
,
p_output
->
i_sid
,
p_output
->
pi_pids
,
p_output
->
i_nb_pids
);
p_output
->
pi_pids
,
p_output
->
i_nb_pids
);
if
(
i_old_sid
&&
i_old_sid
!=
i
_sid
)
if
(
sid_change
&&
i_old
_sid
)
{
{
p_output
->
i_sid
=
i_sid
;
p_output
->
i_sid
=
i_sid
;
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
...
@@ -351,7 +352,22 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -351,7 +352,22 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
!
IsIn
(
pi_wanted_pids
,
i_nb_wanted_pids
,
pi_current_pids
[
i
]
)
)
!
IsIn
(
pi_wanted_pids
,
i_nb_wanted_pids
,
pi_current_pids
[
i
]
)
)
{
{
StopPID
(
p_output
,
pi_current_pids
[
i
]
);
StopPID
(
p_output
,
pi_current_pids
[
i
]
);
b_change
=
1
;
pid_change
=
1
;
}
}
if
(
sid_change
&&
i_ca_handle
&&
i_old_sid
&&
SIDIsSelected
(
i_old_sid
)
)
{
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
{
if
(
pp_sids
[
i
]
->
i_sid
==
i_old_sid
)
{
if
(
pp_sids
[
i
]
->
p_current_pmt
!=
NULL
&&
PMTNeedsDescrambling
(
pp_sids
[
i
]
->
p_current_pmt
)
)
en50221_UpdatePMT
(
pp_sids
[
i
]
->
p_current_pmt
);
break
;
}
}
}
}
}
...
@@ -361,13 +377,14 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -361,13 +377,14 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
!
IsIn
(
pi_current_pids
,
i_nb_current_pids
,
pi_wanted_pids
[
i
]
)
)
!
IsIn
(
pi_current_pids
,
i_nb_current_pids
,
pi_wanted_pids
[
i
]
)
)
{
{
StartPID
(
p_output
,
pi_wanted_pids
[
i
]
);
StartPID
(
p_output
,
pi_wanted_pids
[
i
]
);
b
_change
=
1
;
pid
_change
=
1
;
}
}
}
}
free
(
pi_wanted_pids
);
free
(
pi_wanted_pids
);
free
(
pi_current_pids
);
free
(
pi_current_pids
);
if
(
i_sid
&&
i_sid
!=
i_old
_sid
)
if
(
sid_change
&&
i
_sid
)
{
{
p_output
->
i_sid
=
i_old_sid
;
p_output
->
i_sid
=
i_old_sid
;
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
...
@@ -376,32 +393,17 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -376,32 +393,17 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
{
{
SetPID
(
pp_sids
[
i
]
->
i_pmt_pid
);
SetPID
(
pp_sids
[
i
]
->
i_pmt_pid
);
if
(
pp_sids
[
i
]
->
p_current_pmt
!=
NULL
)
if
(
i_ca_handle
&&
!
SIDIsSelected
(
i_sid
)
{
&&
pp_sids
[
i
]
->
p_current_pmt
!=
NULL
if
(
i_ca_handle
&&
!
SIDIsSelected
(
i_sid
)
&&
PMTNeedsDescrambling
(
pp_sids
[
i
]
->
p_current_pmt
)
)
&&
PMTNeedsDescrambling
(
pp_sids
[
i
]
->
p_current_pmt
)
)
en50221_AddPMT
(
pp_sids
[
i
]
->
p_current_pmt
);
en50221_AddPMT
(
pp_sids
[
i
]
->
p_current_pmt
);
break
;
break
;
}
}
}
}
}
}
}
p_output
->
i_sid
=
i_sid
;
if
(
i_ca_handle
&&
i_sid
&&
SIDIsSelected
(
i_sid
)
)
free
(
p_output
->
pi_pids
);
p_output
->
pi_pids
=
malloc
(
sizeof
(
uint16_t
)
*
i_nb_pids
);
memcpy
(
p_output
->
pi_pids
,
pi_pids
,
sizeof
(
uint16_t
)
*
i_nb_pids
);
p_output
->
i_nb_pids
=
i_nb_pids
;
if
(
i_sid
!=
i_old_sid
)
{
{
NewSDT
(
p_output
);
NewPAT
(
p_output
);
NewPMT
(
p_output
);
}
else
if
(
b_change
)
{
NewPMT
(
p_output
);
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
for
(
i
=
0
;
i
<
i_nb_sids
;
i
++
)
{
{
if
(
pp_sids
[
i
]
->
i_sid
==
i_sid
)
if
(
pp_sids
[
i
]
->
i_sid
==
i_sid
)
...
@@ -413,6 +415,21 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
...
@@ -413,6 +415,21 @@ void demux_Change( output_t *p_output, uint16_t i_sid,
}
}
}
}
}
}
p_output
->
i_sid
=
i_sid
;
free
(
p_output
->
pi_pids
);
p_output
->
pi_pids
=
malloc
(
sizeof
(
uint16_t
)
*
i_nb_pids
);
memcpy
(
p_output
->
pi_pids
,
pi_pids
,
sizeof
(
uint16_t
)
*
i_nb_pids
);
p_output
->
i_nb_pids
=
i_nb_pids
;
if
(
sid_change
)
{
NewSDT
(
p_output
);
NewPAT
(
p_output
);
NewPMT
(
p_output
);
}
else
if
(
pid_change
)
NewPMT
(
p_output
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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