Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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
vlc-2-2
Commits
e2bbf5ca
Commit
e2bbf5ca
authored
Apr 01, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ts: better handling on PAT version changes.
parent
65b5865c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
17 deletions
+52
-17
modules/demux/ts.c
modules/demux/ts.c
+52
-17
No files found.
modules/demux/ts.c
View file @
e2bbf5ca
...
...
@@ -1807,27 +1807,59 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
p_pat
->
i_ts_id
,
p_pat
->
i_version
,
p_pat
->
b_current_next
);
/* Clean old */
for
(
i
=
2
;
i
<
8192
;
i
++
)
if
(
p_sys
->
i_pmt
>
0
)
{
ts_pid_t
*
pid
=
&
p_sys
->
pid
[
i
];
int
i_pmt_rm
=
0
;
ts_pid_t
**
pmt_rm
=
NULL
;
if
(
pid
->
b_valid
)
/* Search pmt to be deleted */
for
(
i
=
0
;
i
<
p_sys
->
i_pmt
;
i
++
)
{
if
(
pid
->
psi
)
ts_pid_t
*
pmt
=
p_sys
->
pmt
[
i
];
vlc_bool_t
b_keep
=
VLC_FALSE
;
for
(
p_program
=
p_pat
->
p_first_program
;
p_program
!=
NULL
;
p_program
=
p_program
->
p_next
)
{
if
(
p
id
->
p_owner
==
pat
->
psi
)
if
(
p
_program
->
i_pid
==
pmt
->
i_pid
&&
p_program
->
i_number
==
pmt
->
psi
->
i_number
)
{
PIDClean
(
p_demux
->
out
,
pid
)
;
TAB_REMOVE
(
p_sys
->
i_pmt
,
p_sys
->
pmt
,
pid
)
;
b_keep
=
VLC_TRUE
;
break
;
}
}
else
if
(
pid
->
p_owner
&&
pid
->
p_owner
->
i_number
!=
0
&&
pid
->
es
->
id
)
if
(
!
b_keep
)
{
/* We only remove es that aren't defined by extra pmt */
PIDClean
(
p_demux
->
out
,
pid
);
TAB_APPEND
(
i_pmt_rm
,
pmt_rm
,
pmt
);
}
}
/* Delete all ES attached to thoses PMT */
for
(
i
=
2
;
i
<
8192
;
i
++
)
{
ts_pid_t
*
pid
=
&
p_sys
->
pid
[
i
];
if
(
pid
->
b_valid
&&
!
pid
->
psi
)
{
for
(
i
=
0
;
i
<
i_pmt_rm
;
i
++
)
{
if
(
pid
->
p_owner
->
i_pid_pcr
==
pmt_rm
[
i
]
->
i_pid
&&
pid
->
es
->
id
)
{
/* We only remove es that aren't defined by extra pmt */
PIDClean
(
p_demux
->
out
,
pid
);
break
;
}
}
}
}
/* Delete PMT pid */
for
(
i
=
0
;
i
<
i_pmt_rm
;
i
++
)
{
PIDClean
(
p_demux
->
out
,
&
p_sys
->
pid
[
pmt_rm
[
i
]
->
i_pid
]
);
TAB_REMOVE
(
p_sys
->
i_pmt
,
p_sys
->
pmt
,
pmt_rm
[
i
]
);
}
if
(
pmt_rm
)
{
free
(
pmt_rm
);
}
}
/* now create programs */
...
...
@@ -1840,13 +1872,16 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
{
ts_pid_t
*
pmt
=
&
p_sys
->
pid
[
p_program
->
i_pid
];
PIDInit
(
pmt
,
VLC_TRUE
,
pat
->
psi
);
pmt
->
psi
->
handle
=
dvbpsi_AttachPMT
(
p_program
->
i_number
,
(
dvbpsi_pmt_callback
)
PMTCallBack
,
p_demux
);
pmt
->
psi
->
i_number
=
p_program
->
i_number
;
if
(
!
pmt
->
b_valid
)
{
PIDInit
(
pmt
,
VLC_TRUE
,
pat
->
psi
);
pmt
->
psi
->
handle
=
dvbpsi_AttachPMT
(
p_program
->
i_number
,
(
dvbpsi_pmt_callback
)
PMTCallBack
,
p_demux
);
pmt
->
psi
->
i_number
=
p_program
->
i_number
;
TAB_APPEND
(
p_sys
->
i_pmt
,
p_sys
->
pmt
,
pmt
);
TAB_APPEND
(
p_sys
->
i_pmt
,
p_sys
->
pmt
,
pmt
);
}
}
}
pat
->
psi
->
i_version
=
p_pat
->
i_version
;
...
...
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