Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
1cfd7773
Commit
1cfd7773
authored
Jun 28, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorized program (un)selection in TS.
parent
0d068c4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
86 deletions
+55
-86
modules/demux/ts.c
modules/demux/ts.c
+55
-86
No files found.
modules/demux/ts.c
View file @
1cfd7773
...
...
@@ -427,7 +427,8 @@ static void IODFree( iod_descriptor_t * );
#define TS_USER_PMT_NUMBER (0)
static
int
UserPmt
(
demux_t
*
p_demux
,
const
char
*
);
static
int
SetPIDFilter
(
demux_t
*
,
int
i_pid
,
bool
b_selected
);
static
int
SetPIDFilter
(
demux_t
*
,
int
i_pid
,
bool
b_selected
);
static
void
SetPrgFilter
(
demux_t
*
,
int
i_prg
,
bool
b_selected
);
#define TS_PACKET_SIZE_188 188
#define TS_PACKET_SIZE_192 192
...
...
@@ -1275,7 +1276,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
#endif
case
DEMUX_SET_GROUP
:
{
ts_prg_psi_t
*
p_prg
;
vlc_list_t
*
p_list
;
i_int
=
(
int
)
va_arg
(
args
,
int
);
...
...
@@ -1284,93 +1284,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if
(
p_sys
->
b_access_control
&&
i_int
>
0
&&
i_int
!=
p_sys
->
i_current_program
)
{
int
i_pmt_pid
=
-
1
;
/* Search pmt to be unselected */
for
(
int
i
=
0
;
i
<
p_sys
->
i_pmt
;
i
++
)
{
ts_pid_t
*
pmt
=
p_sys
->
pmt
[
i
];
for
(
int
i_prg
=
0
;
i_prg
<
pmt
->
psi
->
i_prg
;
i_prg
++
)
{
if
(
pmt
->
psi
->
prg
[
i_prg
]
->
i_number
==
p_sys
->
i_current_program
)
{
i_pmt_pid
=
p_sys
->
pmt
[
i
]
->
i_pid
;
p_prg
=
p_sys
->
pmt
[
i
]
->
psi
->
prg
[
i_prg
];
break
;
}
}
if
(
i_pmt_pid
>
0
)
break
;
}
if
(
i_pmt_pid
>
0
)
{
SetPIDFilter
(
p_demux
,
i_pmt_pid
,
false
);
if
(
p_prg
->
i_pid_pcr
>
0
)
SetPIDFilter
(
p_demux
,
p_prg
->
i_pid_pcr
,
false
);
/* All ES */
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
{
ts_pid_t
*
pid
=
&
p_sys
->
pid
[
i
];
if
(
!
pid
->
b_valid
||
pid
->
psi
)
continue
;
for
(
int
i_prg
=
0
;
i_prg
<
pid
->
p_owner
->
i_prg
;
i_prg
++
)
{
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
{
/* We only remove es that aren't defined by extra pmt */
SetPIDFilter
(
p_demux
,
i
,
false
);
break
;
}
}
}
}
SetPrgFilter
(
p_demux
,
p_sys
->
i_current_program
,
false
);
/* select new program */
p_sys
->
i_current_program
=
i_int
;
i_pmt_pid
=
-
1
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_pmt
;
i
++
)
{
ts_pid_t
*
pmt
=
p_sys
->
pmt
[
i
];
for
(
int
i_prg
=
0
;
i_prg
<
pmt
->
psi
->
i_prg
;
i_prg
++
)
{
if
(
pmt
->
psi
->
prg
[
i_prg
]
->
i_number
==
i_int
)
{
i_pmt_pid
=
p_sys
->
pmt
[
i
]
->
i_pid
;
p_prg
=
p_sys
->
pmt
[
i
]
->
psi
->
prg
[
i_prg
];
break
;
}
}
if
(
i_pmt_pid
>
0
)
break
;
}
if
(
i_pmt_pid
>
0
)
{
SetPIDFilter
(
p_demux
,
i_pmt_pid
,
true
);
if
(
p_prg
->
i_pid_pcr
>
0
)
SetPIDFilter
(
p_demux
,
p_prg
->
i_pid_pcr
,
true
);
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
{
ts_pid_t
*
pid
=
&
p_sys
->
pid
[
i
];
if
(
!
pid
->
b_valid
||
pid
->
psi
)
continue
;
for
(
int
i_prg
=
0
;
i_prg
<
pid
->
p_owner
->
i_prg
;
i_prg
++
)
{
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
{
SetPIDFilter
(
p_demux
,
i
,
true
);
break
;
}
}
}
}
SetPrgFilter
(
p_demux
,
p_sys
->
i_current_program
,
true
);
}
else
if
(
i_int
<=
0
)
{
...
...
@@ -1551,6 +1469,57 @@ static int SetPIDFilter( demux_t *p_demux, int i_pid, bool b_selected )
ACCESS_SET_PRIVATE_ID_STATE
,
i_pid
,
b_selected
);
}
static
void
SetPrgFilter
(
demux_t
*
p_demux
,
int
i_prg_id
,
bool
b_selected
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
ts_prg_psi_t
*
p_prg
=
NULL
;
int
i_pmt_pid
=
-
1
;
/* Search pmt to be unselected */
for
(
int
i
=
0
;
i
<
p_sys
->
i_pmt
;
i
++
)
{
ts_pid_t
*
pmt
=
p_sys
->
pmt
[
i
];
for
(
int
i_prg
=
0
;
i_prg
<
pmt
->
psi
->
i_prg
;
i_prg
++
)
{
if
(
pmt
->
psi
->
prg
[
i_prg
]
->
i_number
==
i_prg_id
)
{
i_pmt_pid
=
p_sys
->
pmt
[
i
]
->
i_pid
;
p_prg
=
p_sys
->
pmt
[
i
]
->
psi
->
prg
[
i_prg
];
break
;
}
}
if
(
i_pmt_pid
>
0
)
break
;
}
if
(
i_pmt_pid
<=
0
)
return
;
assert
(
p_prg
);
SetPIDFilter
(
p_demux
,
i_pmt_pid
,
b_selected
);
if
(
p_prg
->
i_pid_pcr
>
0
)
SetPIDFilter
(
p_demux
,
p_prg
->
i_pid_pcr
,
b_selected
);
/* All ES */
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
{
ts_pid_t
*
pid
=
&
p_sys
->
pid
[
i
];
if
(
!
pid
->
b_valid
||
pid
->
psi
)
continue
;
for
(
int
i_prg
=
0
;
i_prg
<
pid
->
p_owner
->
i_prg
;
i_prg
++
)
{
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
{
/* We only remove/select es that aren't defined by extra pmt */
SetPIDFilter
(
p_demux
,
i
,
b_selected
);
break
;
}
}
}
}
static
void
PIDInit
(
ts_pid_t
*
pid
,
bool
b_psi
,
ts_psi_t
*
p_owner
)
{
bool
b_old_valid
=
pid
->
b_valid
;
...
...
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