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
5cd1816c
Commit
5cd1816c
authored
Dec 08, 2012
by
Denis Charmet
Committed by
Jean-Baptiste Kempf
Dec 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle ordered editions with broken links or empty
Fix #7859 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
2a526466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
modules/demux/mkv/virtual_segment.cpp
modules/demux/mkv/virtual_segment.cpp
+26
-9
No files found.
modules/demux/mkv/virtual_segment.cpp
View file @
5cd1816c
...
...
@@ -122,7 +122,10 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, std::vector<ma
if
(
p_vchap
)
chapters
.
push_back
(
p_vchap
);
}
i_duration
=
chapters
[
chapters
.
size
()
-
1
]
->
i_virtual_stop_time
;
if
(
chapters
.
size
()
)
i_duration
=
chapters
[
chapters
.
size
()
-
1
]
->
i_virtual_stop_time
;
else
i_duration
=
0
;
/* Empty ordered editions will be ignored */
}
else
/* Not ordered or no edition at all */
{
...
...
@@ -258,23 +261,28 @@ void virtual_edition_c::retimeChapters()
virtual_segment_c
::
virtual_segment_c
(
std
::
vector
<
matroska_segment_c
*>
*
p_opened_segments
)
{
/* Main segment */
size_t
i
;
matroska_segment_c
*
p_segment
=
(
*
p_opened_segments
)[
0
];
i_current_edition
=
0
;
i_sys_title
=
0
;
p_current_chapter
=
NULL
;
for
(
size_t
i
=
0
;
i
<
p_segment
->
stored_editions
.
size
();
i
++
)
for
(
i
=
0
;
i
<
p_segment
->
stored_editions
.
size
();
i
++
)
{
/* Get the default edition, if non use the first one */
if
(
p_segment
->
stored_editions
[
i
]
->
b_default
)
i_current_edition
=
i
;
/* Create a virtual edition from opened */
virtual_edition_c
*
p_vedition
=
new
virtual_edition_c
(
p_segment
->
stored_editions
[
i
],
p_opened_segments
);
/*FIXME if p_vedition failed...*/
editions
.
push_back
(
p_vedition
);
/* Ordered empty edition can happen when all chapters are
* on an other segment which couldn't be found... ignore it */
if
(
p_vedition
->
b_ordered
&&
p_vedition
->
i_duration
==
0
)
{
msg_Warn
(
&
p_segment
->
sys
.
demuxer
,
"Edition %s (%lu) links to other segments not found and is empty... ignoring it"
,
p_vedition
->
GetMainName
().
c_str
(),
i
);
delete
p_vedition
;
}
else
editions
.
push_back
(
p_vedition
);
}
/*if we don't have edition create a dummy one*/
if
(
!
p_segment
->
stored_editions
.
size
()
)
...
...
@@ -283,6 +291,15 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene
editions
.
push_back
(
p_vedition
);
}
/* Get the default edition, if there is none, use the first one */
for
(
i
=
0
;
i
<
editions
.
size
();
i
++
)
{
if
(
editions
[
i
]
->
p_edition
&&
editions
[
i
]
->
p_edition
->
b_default
)
{
i_current_edition
=
i
;
break
;
}
}
/* Set current chapter */
p_current_chapter
=
editions
[
i_current_edition
]
->
getChapterbyTimecode
(
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