Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
Steve Lhomme
VLC
Commits
964b5422
Commit
964b5422
authored
Mar 31, 2017
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: ps: split seen / configured states
b_seen was misused for both stream presence and after configuration
parent
2e485524
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
+28
-25
modules/access/dvdnav.c
modules/access/dvdnav.c
+8
-8
modules/access/dvdread.c
modules/access/dvdread.c
+7
-7
modules/demux/mpeg/ps.c
modules/demux/mpeg/ps.c
+6
-5
modules/demux/mpeg/ps.h
modules/demux/mpeg/ps.h
+7
-5
No files found.
modules/access/dvdnav.c
View file @
964b5422
...
...
@@ -534,7 +534,7 @@ static void Close( vlc_object_t *p_this )
for
(
int
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
i
];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_format_Clean
(
&
tk
->
fmt
);
if
(
tk
->
es
)
es_out_Del
(
p_demux
->
out
,
tk
->
es
);
...
...
@@ -942,12 +942,12 @@ static int Demux( demux_t *p_demux )
for
(
int
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
i
];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_format_Clean
(
&
tk
->
fmt
);
if
(
tk
->
es
)
es_out_Del
(
p_demux
->
out
,
tk
->
es
);
}
tk
->
b_
seen
=
false
;
tk
->
b_
configured
=
false
;
}
uint32_t
i_width
,
i_height
;
...
...
@@ -1316,7 +1316,7 @@ static void ESSubtitleUpdate( demux_t *p_demux )
for
(
i_spu
=
0
;
i_spu
<=
0x1F
;
i_spu
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
0xbd20
+
i_spu
)];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_ES_STATE
,
tk
->
es
,
(
bool
)
false
);
...
...
@@ -1382,11 +1382,11 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
i_id
)];
if
(
!
tk
->
b_
seen
)
if
(
!
tk
->
b_
configured
)
{
ESNew
(
p_demux
,
i_id
);
}
if
(
tk
->
b_
seen
&&
tk
->
es
&&
if
(
tk
->
b_
configured
&&
tk
->
es
&&
!
ps_pkt_parse_pes
(
VLC_OBJECT
(
p_demux
),
p_pkt
,
tk
->
i_skip
)
)
{
es_out_Send
(
p_demux
->
out
,
tk
->
es
,
p_pkt
);
...
...
@@ -1436,7 +1436,7 @@ static void ESNew( demux_t *p_demux, int i_id )
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
i_id
)];
bool
b_select
=
false
;
if
(
tk
->
b_
seen
)
return
;
if
(
tk
->
b_
configured
)
return
;
if
(
ps_track_fill
(
tk
,
0
,
i_id
,
NULL
)
)
{
...
...
@@ -1518,7 +1518,7 @@ static void ESNew( demux_t *p_demux, int i_id )
{
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_ES
,
tk
->
es
);
}
tk
->
b_
seen
=
true
;
tk
->
b_
configured
=
true
;
if
(
tk
->
fmt
.
i_cat
==
VIDEO_ES
)
ButtonUpdate
(
p_demux
,
false
);
}
...
...
modules/access/dvdread.c
View file @
964b5422
...
...
@@ -257,7 +257,7 @@ static void Close( vlc_object_t *p_this )
for
(
int
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
i
];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_format_Clean
(
&
tk
->
fmt
);
if
(
tk
->
es
)
es_out_Del
(
p_demux
->
out
,
tk
->
es
);
...
...
@@ -609,11 +609,11 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
i_id
)];
if
(
!
tk
->
b_
seen
)
if
(
!
tk
->
b_
configured
)
{
ESNew
(
p_demux
,
i_id
,
0
);
}
if
(
tk
->
b_
seen
&&
tk
->
es
&&
if
(
tk
->
b_
configured
&&
tk
->
es
&&
!
ps_pkt_parse_pes
(
VLC_OBJECT
(
p_demux
),
p_pkt
,
tk
->
i_skip
)
)
{
es_out_Send
(
p_demux
->
out
,
tk
->
es
,
p_pkt
);
...
...
@@ -647,7 +647,7 @@ static void ESNew( demux_t *p_demux, int i_id, int i_lang )
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
i_id
)];
char
psz_language
[
3
];
if
(
tk
->
b_
seen
)
return
;
if
(
tk
->
b_
configured
)
return
;
if
(
ps_track_fill
(
tk
,
0
,
i_id
,
NULL
)
)
{
...
...
@@ -704,7 +704,7 @@ static void ESNew( demux_t *p_demux, int i_id, int i_lang )
}
tk
->
es
=
es_out_Add
(
p_demux
->
out
,
&
tk
->
fmt
);
tk
->
b_
seen
=
true
;
tk
->
b_
configured
=
true
;
}
/*****************************************************************************
...
...
@@ -841,12 +841,12 @@ static int DvdReadSetArea( demux_t *p_demux, int i_title, int i_chapter,
for
(
int
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
i
];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_format_Clean
(
&
tk
->
fmt
);
if
(
tk
->
es
)
es_out_Del
(
p_demux
->
out
,
tk
->
es
);
}
tk
->
b_
seen
=
false
;
tk
->
b_
configured
=
false
;
}
if
(
p_demux
->
info
.
i_title
!=
i_title
)
...
...
modules/demux/mpeg/ps.c
View file @
964b5422
...
...
@@ -256,7 +256,7 @@ static void Close( vlc_object_t *p_this )
for
(
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_sys
->
tk
[
i
];
if
(
tk
->
b_
seen
)
if
(
tk
->
b_
configured
)
{
es_format_Clean
(
&
tk
->
fmt
);
if
(
tk
->
es
)
es_out_Del
(
p_demux
->
out
,
tk
->
es
);
...
...
@@ -383,7 +383,7 @@ static void NotifyDiscontinuity( ps_track_t *p_tk, es_out_t *out )
for
(
size_t
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
ps_track_t
*
tk
=
&
p_tk
[
i
];
if
(
tk
->
b_
seen
&&
tk
->
es
&&
if
(
tk
->
b_
configured
&&
tk
->
es
&&
es_out_Control
(
out
,
ES_OUT_GET_ES_STATE
,
tk
->
es
,
&
b_selected
)
==
VLC_SUCCESS
&&
b_selected
)
{
...
...
@@ -472,6 +472,7 @@ static int Demux( demux_t *p_demux )
if
(
tk
->
b_seen
&&
!
tk
->
es
&&
tk
->
fmt
.
i_cat
!=
UNKNOWN_ES
)
{
tk
->
es
=
es_out_Add
(
p_demux
->
out
,
&
tk
->
fmt
);
tk
->
b_configured
=
true
;
}
}
}
...
...
@@ -514,7 +515,7 @@ static int Demux( demux_t *p_demux )
bool
b_new
=
false
;
ps_track_t
*
tk
=
&
p_sys
->
tk
[
PS_ID_TO_TK
(
i_id
)];
if
(
!
tk
->
b_
seen
)
if
(
!
tk
->
b_
configured
)
{
if
(
!
ps_track_fill
(
tk
,
&
p_sys
->
psm
,
i_id
,
p_pkt
)
)
{
...
...
@@ -537,7 +538,7 @@ static int Demux( demux_t *p_demux )
tk
->
es
=
es_out_Add
(
p_demux
->
out
,
&
tk
->
fmt
);
b_new
=
true
;
tk
->
b_
seen
=
true
;
tk
->
b_
configured
=
true
;
}
else
{
...
...
@@ -569,7 +570,7 @@ static int Demux( demux_t *p_demux )
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
VLC_TS_0
+
p_sys
->
i_pack_scr
);
}
if
(
tk
->
b_
seen
&&
tk
->
es
&&
if
(
tk
->
b_
configured
&&
tk
->
es
&&
!
ps_pkt_parse_pes
(
VLC_OBJECT
(
p_demux
),
p_pkt
,
tk
->
i_skip
)
)
{
if
(
tk
->
fmt
.
i_cat
==
AUDIO_ES
||
tk
->
fmt
.
i_cat
==
VIDEO_ES
)
...
...
modules/demux/mpeg/ps.h
View file @
964b5422
...
...
@@ -61,7 +61,8 @@ static inline const uint8_t *ps_id_to_lang( const ps_psm_t *, int );
typedef
struct
{
bool
b_seen
;
bool
b_configured
;
bool
b_seen
;
int
i_skip
;
int
i_id
;
int
i_next_block_flags
;
...
...
@@ -78,6 +79,7 @@ static inline void ps_track_init( ps_track_t tk[PS_TK_COUNT] )
int
i
;
for
(
i
=
0
;
i
<
PS_TK_COUNT
;
i
++
)
{
tk
[
i
].
b_configured
=
false
;
tk
[
i
].
b_seen
=
false
;
tk
[
i
].
i_skip
=
0
;
tk
[
i
].
i_id
=
0
;
...
...
@@ -476,10 +478,10 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
continue
;
int
i_tk
=
PS_ID_TO_TK
(
i_id
);
if
(
!
tk
[
i_tk
].
b_
seen
&&
if
(
!
tk
[
i_tk
].
b_
configured
&&
!
ps_track_fill
(
&
tk
[
i_tk
],
p_psm
,
i_id
,
NULL
)
)
{
tk
[
i_tk
].
b_
seen
=
true
;
tk
[
i_tk
].
b_
configured
=
true
;
}
}
return
VLC_SUCCESS
;
...
...
@@ -687,7 +689,7 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
{
ps_track_t
tk_tmp
;
if
(
!
tk
[
i
].
b_
seen
||
!
tk
[
i
].
es
)
continue
;
if
(
!
tk
[
i
].
b_
configured
||
!
tk
[
i
].
es
)
continue
;
if
(
ps_track_fill
(
&
tk_tmp
,
p_psm
,
tk
[
i
].
i_id
,
p_pkt
)
!=
VLC_SUCCESS
)
continue
;
...
...
@@ -701,7 +703,7 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
es_out_Del
(
out
,
tk
[
i
].
es
);
es_format_Clean
(
&
tk
[
i
].
fmt
);
tk_tmp
.
b_
seen
=
true
;
tk_tmp
.
b_
configured
=
true
;
tk
[
i
]
=
tk_tmp
;
tk
[
i
].
es
=
es_out_Add
(
out
,
&
tk
[
i
].
fmt
);
}
...
...
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