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
a2790164
Commit
a2790164
authored
Feb 24, 2012
by
Denis Charmet
Committed by
Jean-Baptiste Kempf
Feb 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use mkv track flags to define the priority of ES
Fix #6199 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
1cc7a5c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
6 deletions
+38
-6
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+34
-5
modules/demux/mkv/matroska_segment_parse.cpp
modules/demux/mkv/matroska_segment_parse.cpp
+3
-1
modules/demux/mkv/mkv.hpp
modules/demux/mkv/mkv.hpp
+1
-0
No files found.
modules/demux/mkv/matroska_segment.cpp
View file @
a2790164
...
...
@@ -922,17 +922,42 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
/* add all es */
msg_Dbg
(
&
sys
.
demuxer
,
"found %d es"
,
(
int
)
tracks
.
size
()
);
bool
b_has_default_video
=
false
;
bool
b_has_default_audio
=
false
;
/* check for default */
for
(
size_t
i_track
=
0
;
i_track
<
tracks
.
size
();
i_track
++
)
{
mkv_track_t
*
p_tk
=
tracks
[
i_track
];
es_format_t
*
p_fmt
=
&
p_tk
->
fmt
;
if
(
p_fmt
->
i_cat
==
VIDEO_ES
)
b_has_default_video
|=
p_tk
->
b_enabled
&&
(
p_tk
->
b_default
||
p_tk
->
b_forced
);
else
if
(
p_fmt
->
i_cat
==
AUDIO_ES
)
b_has_default_audio
|=
p_tk
->
b_enabled
&&
(
p_tk
->
b_default
||
p_tk
->
b_forced
);
}
for
(
size_t
i_track
=
0
;
i_track
<
tracks
.
size
();
i_track
++
)
{
mkv_track_t
*
p_tk
=
tracks
[
i_track
];
es_format_t
*
p_fmt
=
&
p_tk
->
fmt
;
if
(
p_fmt
->
i_cat
==
UNKNOWN_ES
||
!
p_tk
->
psz_codec
)
if
(
unlikely
(
p_fmt
->
i_cat
==
UNKNOWN_ES
||
!
p_tk
->
psz_codec
)
)
{
msg_Warn
(
&
sys
.
demuxer
,
"invalid track[%d, n=%d]"
,
(
int
)
i_track
,
p_tk
->
i_number
);
p_tk
->
p_es
=
NULL
;
continue
;
}
else
if
(
unlikely
(
!
b_has_default_video
&&
p_fmt
->
i_cat
==
VIDEO_ES
)
)
{
p_tk
->
b_default
=
true
;
b_has_default_video
=
true
;
}
else
if
(
unlikely
(
!
b_has_default_audio
&&
p_fmt
->
i_cat
==
AUDIO_ES
)
)
{
p_tk
->
b_default
=
true
;
b_has_default_audio
=
true
;
}
if
(
!
strcmp
(
p_tk
->
psz_codec
,
"V_MS/VFW/FOURCC"
)
)
{
...
...
@@ -1334,10 +1359,14 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
msg_Err
(
&
sys
.
demuxer
,
"unknown codec id=`%s'"
,
p_tk
->
psz_codec
);
p_tk
->
fmt
.
i_codec
=
VLC_FOURCC
(
'u'
,
'n'
,
'd'
,
'f'
);
}
if
(
p_tk
->
b_default
)
{
p_tk
->
fmt
.
i_priority
=
1000
;
}
if
(
unlikely
(
!
p_tk
->
b_enabled
)
)
p_tk
->
fmt
.
i_priority
=
-
2
;
else
if
(
p_tk
->
b_forced
)
p_tk
->
fmt
.
i_priority
=
1
;
else
if
(
p_tk
->
b_default
)
p_tk
->
fmt
.
i_priority
=
0
;
else
p_tk
->
fmt
.
i_priority
=
-
1
;
p_tk
->
p_es
=
es_out_Add
(
sys
.
demuxer
.
out
,
&
p_tk
->
fmt
);
...
...
modules/demux/mkv/matroska_segment_parse.cpp
View file @
a2790164
...
...
@@ -179,6 +179,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
tk
->
b_default
=
true
;
tk
->
b_enabled
=
true
;
tk
->
b_forced
=
false
;
tk
->
b_silent
=
false
;
tk
->
i_number
=
tracks
.
size
()
-
1
;
tk
->
i_extra_data
=
0
;
...
...
@@ -254,7 +255,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
{
KaxTrackFlagEnabled
&
fenb
=
*
(
KaxTrackFlagEnabled
*
)
l
;
//
tk->b_enabled = uint32( fenb );
tk
->
b_enabled
=
uint32
(
fenb
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | | + Track Enabled=%u"
,
uint32
(
fenb
)
);
}
else
if
(
MKV_IS_ID
(
l
,
KaxTrackFlagDefault
)
)
...
...
@@ -267,6 +268,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
else
if
(
MKV_IS_ID
(
l
,
KaxTrackFlagForced
)
)
// UNUSED
{
KaxTrackFlagForced
&
ffor
=
*
(
KaxTrackFlagForced
*
)
l
;
tk
->
b_forced
=
uint32
(
ffor
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | | + Track Forced=%u"
,
uint32
(
ffor
)
);
}
...
...
modules/demux/mkv/mkv.hpp
View file @
a2790164
...
...
@@ -180,6 +180,7 @@ struct mkv_track_t
bool
b_default
;
bool
b_enabled
;
bool
b_forced
;
unsigned
int
i_number
;
unsigned
int
i_extra_data
;
...
...
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