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
03f53a77
Commit
03f53a77
authored
May 09, 2014
by
Denis Charmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep the selected languages at segment change
Fix #11118
parent
741f4af4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
modules/demux/mkv/virtual_segment.cpp
modules/demux/mkv/virtual_segment.cpp
+27
-0
src/input/es_out.c
src/input/es_out.c
+3
-0
No files found.
modules/demux/mkv/virtual_segment.cpp
View file @
03f53a77
...
...
@@ -623,6 +623,24 @@ void virtual_chapter_c::print()
void
virtual_segment_c
::
ChangeSegment
(
matroska_segment_c
*
p_old
,
matroska_segment_c
*
p_new
,
mtime_t
i_start_time
)
{
size_t
i
,
j
;
char
*
sub_lang
=
NULL
,
*
aud_lang
=
NULL
;
for
(
i
=
0
;
i
<
p_old
->
tracks
.
size
();
i
++
)
{
mkv_track_t
*
p_tk
=
p_old
->
tracks
[
i
];
es_format_t
*
p_ofmt
=
&
p_tk
->
fmt
;
if
(
p_tk
->
p_es
)
{
bool
state
=
false
;
es_out_Control
(
p_old
->
sys
.
demuxer
.
out
,
ES_OUT_GET_ES_STATE
,
p_tk
->
p_es
,
&
state
);
if
(
state
)
{
if
(
p_ofmt
->
i_cat
==
AUDIO_ES
)
aud_lang
=
p_tk
->
fmt
.
psz_language
;
else
if
(
p_ofmt
->
i_cat
==
SPU_ES
)
sub_lang
=
p_tk
->
fmt
.
psz_language
;
}
}
}
for
(
i
=
0
;
i
<
p_new
->
tracks
.
size
();
i
++
)
{
mkv_track_t
*
p_tk
=
p_new
->
tracks
[
i
];
...
...
@@ -661,6 +679,15 @@ void virtual_segment_c::ChangeSegment( matroska_segment_c * p_old, matroska_segm
}
}
}
p_tk
->
fmt
.
i_priority
&=
~
(
0x10
);
if
(
(
sub_lang
&&
p_nfmt
->
i_cat
==
SPU_ES
&&
!
strcasecmp
(
sub_lang
,
p_nfmt
->
psz_language
)
)
||
(
aud_lang
&&
p_nfmt
->
i_cat
==
AUDIO_ES
&&
!
strcasecmp
(
aud_lang
,
p_nfmt
->
psz_language
)
)
)
{
msg_Warn
(
&
p_old
->
sys
.
demuxer
,
"Since previous segment used lang %s forcing track %zu"
,
p_nfmt
->
psz_language
,
i
);
p_tk
->
fmt
.
i_priority
|=
0x10
;
p_tk
->
b_forced
=
true
;
}
}
p_new
->
Select
(
i_start_time
);
p_old
->
UnSelect
();
...
...
src/input/es_out.c
View file @
03f53a77
...
...
@@ -1843,6 +1843,9 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
(
p_sys
->
p_es_sub
&&
p_sys
->
p_es_sub
->
fmt
.
i_priority
<
es
->
fmt
.
i_priority
)
)
i_wanted
=
es
->
i_channel
;
else
if
(
p_sys
->
p_es_sub
&&
p_sys
->
p_es_sub
->
fmt
.
i_priority
>=
es
->
fmt
.
i_priority
)
i_wanted
=
p_sys
->
p_es_sub
->
i_channel
;
}
if
(
p_sys
->
i_sub_last
>=
0
)
...
...
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