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
09871852
Commit
09871852
authored
Mar 05, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: ts: SetPIDFilter: pass by pid
parent
33095a8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
26 deletions
+20
-26
modules/demux/ts.c
modules/demux/ts.c
+20
-26
No files found.
modules/demux/ts.c
View file @
09871852
...
@@ -518,7 +518,7 @@ static void IODFree( iod_descriptor_t * );
...
@@ -518,7 +518,7 @@ static void IODFree( iod_descriptor_t * );
#define TS_USER_PMT_NUMBER (0)
#define TS_USER_PMT_NUMBER (0)
static
int
UserPmt
(
demux_t
*
p_demux
,
const
char
*
);
static
int
UserPmt
(
demux_t
*
p_demux
,
const
char
*
);
static
int
SetPIDFilter
(
demux_
t
*
,
int
i_pid
,
bool
b_selected
);
static
int
SetPIDFilter
(
demux_
sys_t
*
,
ts_pid_t
*
,
bool
b_selected
);
static
void
SetPrgFilter
(
demux_t
*
,
int
i_prg
,
bool
b_selected
);
static
void
SetPrgFilter
(
demux_t
*
,
int
i_prg
,
bool
b_selected
);
#define TS_PACKET_SIZE_188 188
#define TS_PACKET_SIZE_188 188
...
@@ -1078,9 +1078,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -1078,9 +1078,9 @@ static int Open( vlc_object_t *p_this )
VLC_DVBPSI_DEMUX_TABLE_INIT
(
&
p_sys
->
pid
[
0x12
],
p_demux
);
VLC_DVBPSI_DEMUX_TABLE_INIT
(
&
p_sys
->
pid
[
0x12
],
p_demux
);
VLC_DVBPSI_DEMUX_TABLE_INIT
(
&
p_sys
->
pid
[
0x14
],
p_demux
);
VLC_DVBPSI_DEMUX_TABLE_INIT
(
&
p_sys
->
pid
[
0x14
],
p_demux
);
if
(
p_sys
->
b_access_control
&&
if
(
p_sys
->
b_access_control
&&
(
SetPIDFilter
(
p_
demux
,
0x11
,
true
)
||
(
SetPIDFilter
(
p_
sys
,
&
p_sys
->
pid
[
0x11
]
,
true
)
||
SetPIDFilter
(
p_
demux
,
0x14
,
true
)
||
SetPIDFilter
(
p_
sys
,
&
p_sys
->
pid
[
0x14
]
,
true
)
||
SetPIDFilter
(
p_
demux
,
0x12
,
true
)
)
SetPIDFilter
(
p_
sys
,
&
p_sys
->
pid
[
0x12
]
,
true
)
)
)
)
p_sys
->
b_access_control
=
false
;
p_sys
->
b_access_control
=
false
;
}
}
...
@@ -1754,22 +1754,20 @@ error:
...
@@ -1754,22 +1754,20 @@ error:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
static
int
SetPIDFilter
(
demux_
t
*
p_demux
,
int
i
_pid
,
bool
b_selected
)
static
int
SetPIDFilter
(
demux_
sys_t
*
p_sys
,
ts_pid_t
*
p
_pid
,
bool
b_selected
)
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
if
(
!
p_sys
->
b_access_control
)
if
(
!
p_sys
->
b_access_control
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
return
stream_Control
(
p_sys
->
stream
,
STREAM_SET_PRIVATE_ID_STATE
,
return
stream_Control
(
p_sys
->
stream
,
STREAM_SET_PRIVATE_ID_STATE
,
i_pid
,
b_selected
);
p_pid
->
i_pid
,
b_selected
);
}
}
static
void
SetPrgFilter
(
demux_t
*
p_demux
,
int
i_prg_id
,
bool
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
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
ts_pmt_t
*
p_pmt
=
NULL
;
ts_pmt_t
*
p_pmt
=
NULL
;
int
i_pmt_pid
=
-
1
;
ts_pid_t
*
pid
=
NULL
;
/* Search pmt to be unselected */
/* Search pmt to be unselected */
if
(
unlikely
(
p_sys
->
pid
[
0
].
type
!=
TYPE_PAT
))
if
(
unlikely
(
p_sys
->
pid
[
0
].
type
!=
TYPE_PAT
))
...
@@ -1783,23 +1781,19 @@ static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool b_selected )
...
@@ -1783,23 +1781,19 @@ static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool b_selected )
if
(
pmtpid
->
u
.
p_pmt
->
i_number
==
i_prg_id
)
if
(
pmtpid
->
u
.
p_pmt
->
i_number
==
i_prg_id
)
{
{
i_pmt_pid
=
pmtpid
->
i_
pid
;
pid
=
pmt
pid
;
p_pmt
=
p
mtp
id
->
u
.
p_pmt
;
p_pmt
=
pid
->
u
.
p_pmt
;
break
;
break
;
}
}
if
(
i_pmt_pid
>
0
)
break
;
}
}
if
(
i_pmt_pid
<=
0
)
if
(
!
pid
)
return
;
return
;
assert
(
p_pmt
);
p_pmt
->
pcr
.
b_disable
=
!
p_sys
->
b_trust_pcr
;
p_pmt
->
pcr
.
b_disable
=
!
p_sys
->
b_trust_pcr
;
SetPIDFilter
(
p_
demux
,
i_pmt_
pid
,
b_selected
);
SetPIDFilter
(
p_
sys
,
pid
,
b_selected
);
if
(
p_pmt
->
i_pid_pcr
>
0
)
if
(
p_pmt
->
i_pid_pcr
>
0
)
SetPIDFilter
(
p_
demux
,
p_pmt
->
i_pid_pcr
,
b_selected
);
SetPIDFilter
(
p_
sys
,
&
p_sys
->
pid
[
p_pmt
->
i_pid_pcr
]
,
b_selected
);
/* All ES */
/* All ES */
for
(
int
i
=
0
;
i
<
p_pmt
->
e_streams
.
i_size
;
i
++
)
for
(
int
i
=
0
;
i
<
p_pmt
->
e_streams
.
i_size
;
i
++
)
...
@@ -1808,7 +1802,7 @@ static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool b_selected )
...
@@ -1808,7 +1802,7 @@ static void SetPrgFilter( demux_t *p_demux, int i_prg_id, bool b_selected )
assert
(
pespid
->
type
==
TYPE_PES
);
assert
(
pespid
->
type
==
TYPE_PES
);
/* We only remove/select es that aren't defined by extra pmt */
/* We only remove/select es that aren't defined by extra pmt */
if
(
pespid
->
u
.
p_pes
->
es
.
id
||
!
b_selected
)
if
(
pespid
->
u
.
p_pes
->
es
.
id
||
!
b_selected
)
SetPIDFilter
(
p_
demux
,
i
,
b_selected
);
SetPIDFilter
(
p_
sys
,
pespid
,
b_selected
);
}
}
}
}
...
@@ -1938,7 +1932,7 @@ static void PIDRelease( demux_t *p_demux, ts_pid_t *pid )
...
@@ -1938,7 +1932,7 @@ static void PIDRelease( demux_t *p_demux, ts_pid_t *pid )
}
}
SetPIDFilter
(
p_demux
,
pid
->
i_
pid
,
false
);
SetPIDFilter
(
p_demux
->
p_sys
,
pid
,
false
);
PIDReset
(
pid
);
PIDReset
(
pid
);
}
}
}
}
...
@@ -5019,8 +5013,8 @@ static void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid )
...
@@ -5019,8 +5013,8 @@ static void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid )
}
}
p_sys
->
i_pmt_es
+=
1
+
pid
->
u
.
p_pes
->
extra_es
.
i_size
;
p_sys
->
i_pmt_es
+=
1
+
pid
->
u
.
p_pes
->
extra_es
.
i_size
;
if
(
pid
->
u
.
p_pes
->
es
.
id
!=
NULL
&&
ProgramIsSelected
(
p_
demux
,
pid
->
p_parent
->
u
.
p_pmt
->
i_number
)
)
if
(
pid
->
u
.
p_pes
->
es
.
id
!=
NULL
&&
ProgramIsSelected
(
p_
sys
,
pid
->
p_parent
->
u
.
p_pmt
->
i_number
)
)
SetPIDFilter
(
p_
demux
,
pid
->
i_
pid
,
true
);
SetPIDFilter
(
p_
sys
,
pid
,
true
);
}
}
}
}
}
}
...
@@ -5093,8 +5087,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
...
@@ -5093,8 +5087,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
ValidateDVBMeta
(
p_demux
,
p_pmt
->
i_pid_pcr
);
ValidateDVBMeta
(
p_demux
,
p_pmt
->
i_pid_pcr
);
if
(
ProgramIsSelected
(
p_
demux
,
p_pmt
->
i_number
)
)
if
(
ProgramIsSelected
(
p_
sys
,
p_pmt
->
i_number
)
)
SetPIDFilter
(
p_
demux
,
p_pmt
->
i_pid_pcr
,
true
);
/* Set demux filter */
SetPIDFilter
(
p_
sys
,
&
p_sys
->
pid
[
p_pmt
->
i_pid_pcr
]
,
true
);
/* Set demux filter */
/* Parse PMT descriptors */
/* Parse PMT descriptors */
ts_pmt_registration_type_t
registration_type
=
TS_PMT_REGISTRATION_NONE
;
ts_pmt_registration_type_t
registration_type
=
TS_PMT_REGISTRATION_NONE
;
...
@@ -5426,7 +5420,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
...
@@ -5426,7 +5420,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
}
}
if
(
ProgramIsSelected
(
p_demux
,
p_pmt
->
i_number
)
&&
pespid
->
u
.
p_pes
->
es
.
id
!=
NULL
)
if
(
ProgramIsSelected
(
p_demux
,
p_pmt
->
i_number
)
&&
pespid
->
u
.
p_pes
->
es
.
id
!=
NULL
)
SetPIDFilter
(
p_
demux
,
p_dvbpsies
->
i_
pid
,
true
);
/* Set demux filter */
SetPIDFilter
(
p_
sys
,
pes
pid
,
true
);
/* Set demux filter */
}
}
/* Set CAM descrambling */
/* Set CAM descrambling */
...
@@ -5564,7 +5558,7 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
...
@@ -5564,7 +5558,7 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
ARRAY_APPEND
(
p_sys
->
programs
,
p_program
->
i_number
);
ARRAY_APPEND
(
p_sys
->
programs
,
p_program
->
i_number
);
}
}
if
(
SetPIDFilter
(
p_
demux
,
p_program
->
i_
pid
,
true
)
)
if
(
SetPIDFilter
(
p_
sys
,
pmt
pid
,
true
)
)
p_sys
->
b_access_control
=
false
;
p_sys
->
b_access_control
=
false
;
else
if
(
p_sys
->
es_creation
==
DELAY_ES
)
else
if
(
p_sys
->
es_creation
==
DELAY_ES
)
p_sys
->
es_creation
=
CREATE_ES
;
p_sys
->
es_creation
=
CREATE_ES
;
...
...
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