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
1f08a9d3
Commit
1f08a9d3
authored
Mar 28, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: handle missing linked segments (seg->missing->seg)
parent
e617b434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
16 deletions
+40
-16
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+40
-16
No files found.
modules/demux/mkv.cpp
View file @
1f08a9d3
...
...
@@ -528,12 +528,15 @@ public:
class
virtual_segment_t
{
public:
virtual_segment_t
()
virtual_segment_t
(
matroska_segment_t
*
p_segment
)
:
i_current_segment
(
0
)
{}
{
linked_segments
.
push_back
(
p_segment
);
std
::
vector
<
matroska_segment_t
*>
linked_segments
;
size_t
i_current_segment
;
AppendUID
(
p_segment
->
segment_uid
);
AppendUID
(
p_segment
->
prev_segment_uid
);
AppendUID
(
p_segment
->
next_segment_uid
);
}
void
Sort
();
size_t
AddSegment
(
matroska_segment_t
*
p_segment
);
...
...
@@ -557,6 +560,13 @@ public:
}
return
false
;
}
protected:
std
::
vector
<
matroska_segment_t
*>
linked_segments
;
std
::
vector
<
const
KaxSegmentUID
>
linked_uids
;
size_t
i_current_segment
;
void
AppendUID
(
const
EbmlBinary
&
UID
);
};
class
matroska_stream_t
...
...
@@ -3423,10 +3433,7 @@ void demux_sys_t::PreloadLinked( matroska_segment_t *p_segment )
size_t
i_preloaded
,
i
;
delete
p_current_segment
;
p_current_segment
=
new
virtual_segment_t
();
// fill our current virtual segment with the used segment from the current stream
p_current_segment
->
linked_segments
.
push_back
(
p_segment
);
p_current_segment
=
new
virtual_segment_t
(
p_segment
);
// fill our current virtual segment with all hard linked segments
do
{
...
...
@@ -3458,6 +3465,9 @@ bool matroska_segment_t::CompareSegmentUIDs( const matroska_segment_t * p_item_a
if
(
*
p_itema
==
p_item_b
->
segment_uid
)
return
true
;
if
(
*
p_itema
==
p_item_b
->
prev_segment_uid
)
return
true
;
return
false
;
}
...
...
@@ -3557,16 +3567,17 @@ size_t virtual_segment_t::AddSegment( matroska_segment_t *p_segment )
}
// find possible mates
for
(
i
=
0
;
i
<
linked_
segment
s
.
size
();
i
++
)
for
(
i
=
0
;
i
<
linked_
uid
s
.
size
();
i
++
)
{
if
(
p_segment
->
segment_uid
==
linked_segments
[
i
]
->
prev_segment_uid
)
{
linked_segments
.
push_back
(
p_segment
);
return
1
;
}
if
(
p_segment
->
segment_uid
==
linked_segments
[
i
]
->
next_segment_uid
)
if
(
p_segment
->
segment_uid
==
linked_uids
[
i
]
||
p_segment
->
prev_segment_uid
==
linked_uids
[
i
]
||
p_segment
->
next_segment_uid
==
linked_uids
[
i
]
)
{
linked_segments
.
push_back
(
p_segment
);
AppendUID
(
p_segment
->
prev_segment_uid
);
AppendUID
(
p_segment
->
next_segment_uid
);
return
1
;
}
}
...
...
@@ -3597,4 +3608,17 @@ void virtual_segment_t::LoadCues( )
{
linked_segments
[
i
]
->
LoadCues
();
}
}
\ No newline at end of file
}
void
virtual_segment_t
::
AppendUID
(
const
EbmlBinary
&
UID
)
{
if
(
UID
.
GetBuffer
()
==
NULL
)
return
;
for
(
size_t
i
=
0
;
i
<
linked_uids
.
size
();
i
++
)
{
if
(
UID
==
linked_uids
[
i
]
)
return
;
}
linked_uids
.
push_back
(
*
(
KaxSegmentUID
*
)(
&
UID
)
);
}
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