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
0d068c4a
Commit
0d068c4a
authored
Jun 28, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No functional changes (ts).
parent
5c040f07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
63 deletions
+34
-63
modules/demux/ts.c
modules/demux/ts.c
+34
-63
No files found.
modules/demux/ts.c
View file @
0d068c4a
...
@@ -427,6 +427,8 @@ static void IODFree( iod_descriptor_t * );
...
@@ -427,6 +427,8 @@ 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
);
#define TS_PACKET_SIZE_188 188
#define TS_PACKET_SIZE_188 188
#define TS_PACKET_SIZE_192 192
#define TS_PACKET_SIZE_192 192
#define TS_PACKET_SIZE_204 204
#define TS_PACKET_SIZE_204 204
...
@@ -696,14 +698,11 @@ static int Open( vlc_object_t *p_this )
...
@@ -696,14 +698,11 @@ static int Open( vlc_object_t *p_this )
#endif
#endif
if
(
p_sys
->
b_access_control
)
if
(
p_sys
->
b_access_control
)
{
{
if
(
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
if
(
SetPIDFilter
(
p_demux
,
0x11
,
true
)
||
ACCESS_SET_PRIVATE_ID_STATE
,
0x11
,
true
)
||
#ifdef TS_USE_TDT
#ifdef TS_USE_TDT
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
0x14
,
true
)
||
ACCESS_SET_PRIVATE_ID_STATE
,
0x14
,
true
)
||
#endif
#endif
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
0x12
,
true
)
)
ACCESS_SET_PRIVATE_ID_STATE
,
0x12
,
true
)
)
p_sys
->
b_access_control
=
false
;
p_sys
->
b_access_control
=
false
;
}
}
}
}
...
@@ -867,13 +866,9 @@ static void Close( vlc_object_t *p_this )
...
@@ -867,13 +866,9 @@ static void Close( vlc_object_t *p_this )
msg_Dbg
(
p_demux
,
" - pid[%d] seen"
,
pid
->
i_pid
);
msg_Dbg
(
p_demux
,
" - pid[%d] seen"
,
pid
->
i_pid
);
}
}
if
(
p_sys
->
b_access_control
&&
pid
->
i_pid
>
0
)
{
/* too much */
/* too much */
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
if
(
pid
->
i_pid
>
0
)
ACCESS_SET_PRIVATE_ID_STATE
,
pid
->
i_pid
,
SetPIDFilter
(
p_demux
,
pid
->
i_pid
,
false
);
false
);
}
}
}
vlc_mutex_lock
(
&
p_sys
->
csa_lock
);
vlc_mutex_lock
(
&
p_sys
->
csa_lock
);
...
@@ -1310,13 +1305,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -1310,13 +1305,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if
(
i_pmt_pid
>
0
)
if
(
i_pmt_pid
>
0
)
{
{
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
i_pmt_pid
,
false
);
ACCESS_SET_PRIVATE_ID_STATE
,
i_pmt_pid
,
false
);
if
(
p_prg
->
i_pid_pcr
>
0
)
if
(
p_prg
->
i_pid_pcr
>
0
)
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
p_prg
->
i_pid_pcr
,
false
);
ACCESS_SET_PRIVATE_ID_STATE
,
p_prg
->
i_pid_pcr
,
false
);
/* All ES */
/* All ES */
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
{
{
...
@@ -1330,10 +1322,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -1330,10 +1322,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
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 */
/* We only remove es that aren't defined by extra pmt */
stream_Control
(
p_demux
->
s
,
SetPIDFilter
(
p_demux
,
i
,
false
);
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
i
,
false
);
break
;
break
;
}
}
}
}
...
@@ -1361,13 +1350,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -1361,13 +1350,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
}
}
if
(
i_pmt_pid
>
0
)
if
(
i_pmt_pid
>
0
)
{
{
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
i_pmt_pid
,
true
);
ACCESS_SET_PRIVATE_ID_STATE
,
i_pmt_pid
,
true
);
if
(
p_prg
->
i_pid_pcr
>
0
)
if
(
p_prg
->
i_pid_pcr
>
0
)
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
p_prg
->
i_pid_pcr
,
true
);
ACCESS_SET_PRIVATE_ID_STATE
,
p_prg
->
i_pid_pcr
,
true
);
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
for
(
int
i
=
2
;
i
<
8192
;
i
++
)
{
{
...
@@ -1380,10 +1365,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -1380,10 +1365,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
{
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
==
i_pmt_pid
&&
pid
->
es
->
id
)
{
{
stream_Control
(
p_demux
->
s
,
SetPIDFilter
(
p_demux
,
i
,
true
);
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
i
,
true
);
break
;
break
;
}
}
}
}
...
@@ -1558,6 +1540,17 @@ error:
...
@@ -1558,6 +1540,17 @@ error:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
static
int
SetPIDFilter
(
demux_t
*
p_demux
,
int
i_pid
,
bool
b_selected
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
if
(
!
p_sys
->
b_access_control
)
return
VLC_EGENERIC
;
return
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
i_pid
,
b_selected
);
}
static
void
PIDInit
(
ts_pid_t
*
pid
,
bool
b_psi
,
ts_psi_t
*
p_owner
)
static
void
PIDInit
(
ts_pid_t
*
pid
,
bool
b_psi
,
ts_psi_t
*
p_owner
)
{
{
bool
b_old_valid
=
pid
->
b_valid
;
bool
b_old_valid
=
pid
->
b_valid
;
...
@@ -2634,10 +2627,7 @@ static void ValidateDVBMeta( demux_t *p_demux, int i_pid )
...
@@ -2634,10 +2627,7 @@ static void ValidateDVBMeta( demux_t *p_demux, int i_pid )
p_pid
->
psi
=
NULL
;
p_pid
->
psi
=
NULL
;
p_pid
->
b_valid
=
false
;
p_pid
->
b_valid
=
false
;
}
}
if
(
p_sys
->
b_access_control
)
SetPIDFilter
(
p_demux
,
i
,
false
);
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
i
,
false
);
}
}
p_sys
->
b_dvb_meta
=
false
;
p_sys
->
b_dvb_meta
=
false
;
}
}
...
@@ -4023,9 +4013,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
...
@@ -4023,9 +4013,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
)
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
)
{
{
/* Set demux filter */
/* Set demux filter */
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
prg
->
i_pid_pcr
,
true
);
ACCESS_SET_PRIVATE_ID_STATE
,
prg
->
i_pid_pcr
,
true
);
}
}
else
if
(
p_sys
->
b_access_control
)
else
if
(
p_sys
->
b_access_control
)
{
{
...
@@ -4222,9 +4210,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
...
@@ -4222,9 +4210,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
(
pid
->
es
->
id
!=
NULL
||
p_sys
->
b_udp_out
)
)
(
pid
->
es
->
id
!=
NULL
||
p_sys
->
b_udp_out
)
)
{
{
/* Set demux filter */
/* Set demux filter */
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
p_es
->
i_pid
,
true
);
ACCESS_SET_PRIVATE_ID_STATE
,
p_es
->
i_pid
,
true
);
}
}
}
}
...
@@ -4238,9 +4224,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
...
@@ -4238,9 +4224,7 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
{
{
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
)
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
)
{
{
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
SetPIDFilter
(
p_demux
,
pp_clean
[
i
]
->
i_pid
,
false
);
ACCESS_SET_PRIVATE_ID_STATE
,
pp_clean
[
i
]
->
i_pid
,
false
);
}
}
PIDClean
(
p_demux
,
pp_clean
[
i
]
);
PIDClean
(
p_demux
,
pp_clean
[
i
]
);
...
@@ -4322,13 +4306,8 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
...
@@ -4322,13 +4306,8 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
!=
pmt_rm
[
j
]
->
i_pid
)
if
(
pid
->
p_owner
->
prg
[
i_prg
]
->
i_pid_pmt
!=
pmt_rm
[
j
]
->
i_pid
)
continue
;
continue
;
if
(
p_sys
->
b_access_control
&&
pid
->
es
->
id
)
if
(
pid
->
es
->
id
)
{
SetPIDFilter
(
p_demux
,
i
,
false
);
if
(
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
i
,
false
)
)
p_sys
->
b_access_control
=
false
;
}
PIDClean
(
p_demux
,
pid
);
PIDClean
(
p_demux
,
pid
);
break
;
break
;
...
@@ -4339,13 +4318,7 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
...
@@ -4339,13 +4318,7 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
/* Delete PMT pid */
/* Delete PMT pid */
for
(
int
i
=
0
;
i
<
i_pmt_rm
;
i
++
)
for
(
int
i
=
0
;
i
<
i_pmt_rm
;
i
++
)
{
{
if
(
p_sys
->
b_access_control
)
SetPIDFilter
(
p_demux
,
pmt_rm
[
i
]
->
i_pid
,
false
);
{
if
(
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
ACCESS_SET_PRIVATE_ID_STATE
,
pmt_rm
[
i
]
->
i_pid
,
false
)
)
p_sys
->
b_access_control
=
false
;
}
for
(
int
i_prg
=
0
;
i_prg
<
pmt_rm
[
i
]
->
psi
->
i_prg
;
i_prg
++
)
for
(
int
i_prg
=
0
;
i_prg
<
pmt_rm
[
i
]
->
psi
->
i_prg
;
i_prg
++
)
{
{
...
@@ -4410,9 +4383,7 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
...
@@ -4410,9 +4383,7 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
if
(
p_sys
->
i_current_program
==
0
)
if
(
p_sys
->
i_current_program
==
0
)
p_sys
->
i_current_program
=
p_program
->
i_number
;
p_sys
->
i_current_program
=
p_program
->
i_number
;
if
(
stream_Control
(
p_demux
->
s
,
STREAM_CONTROL_ACCESS
,
if
(
SetPIDFilter
(
p_demux
,
p_program
->
i_pid
,
true
)
)
ACCESS_SET_PRIVATE_ID_STATE
,
p_program
->
i_pid
,
true
)
)
p_sys
->
b_access_control
=
false
;
p_sys
->
b_access_control
=
false
;
}
}
}
}
...
...
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