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
74671a11
Commit
74671a11
authored
Mar 13, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: segment preloading now works
parent
0adee234
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+25
-17
No files found.
modules/demux/mkv.cpp
View file @
74671a11
...
...
@@ -522,8 +522,8 @@ public:
delete
p_es
;
}
vlc_stream_io_callback
*
p_in
;
EbmlStream
*
p_es
;
IOCallback
*
p_in
;
EbmlStream
*
p_es
;
std
::
vector
<
matroska_segment_t
*>
segments
;
int
i_current_segment
;
...
...
@@ -586,7 +586,7 @@ public:
matroska_segment_t
*
FindSegment
(
EbmlBinary
&
uid
)
const
;
void
PreloadFamily
(
);
void
PreloadLinked
(
);
bool
AnalyseAllSegmentsFound
(
EbmlStream
*
p_estream
);
matroska_stream_t
*
AnalyseAllSegmentsFound
(
EbmlStream
*
p_estream
);
};
static
int
Demux
(
demux_t
*
);
...
...
@@ -635,17 +635,18 @@ static int Open( vlc_object_t * p_this )
p_stream
->
p_in
=
new
vlc_stream_io_callback
(
p_demux
->
s
);
p_stream
->
p_es
=
new
EbmlStream
(
*
p_stream
->
p_in
);
p_segment
=
new
matroska_segment_t
(
*
p_sys
,
*
p_stream
->
p_es
);
p_stream
->
segments
.
push_back
(
p_segment
);
p_stream
->
i_current_segment
=
0
;
if
(
p_stream
->
p_es
==
NULL
)
{
msg_Err
(
p_demux
,
"failed to create EbmlStream"
);
delete
p_sys
;
return
VLC_EGENERIC
;
}
p_segment
=
new
matroska_segment_t
(
*
p_sys
,
*
p_stream
->
p_es
);
p_stream
->
segments
.
push_back
(
p_segment
);
p_stream
->
i_current_segment
=
0
;
/* Find the EbmlHead element */
el
=
p_stream
->
p_es
->
FindNextID
(
EbmlHead
::
ClassInfos
,
0xFFFFFFFFL
);
if
(
el
==
NULL
)
...
...
@@ -718,12 +719,19 @@ static int Open( vlc_object_t * p_this )
StdIOCallback
*
p_file_io
=
new
StdIOCallback
(
s_filename
.
c_str
(),
MODE_READ
);
EbmlStream
*
p_estream
=
new
EbmlStream
(
*
p_file_io
);
if
(
!
p_sys
->
AnalyseAllSegmentsFound
(
p_estream
))
p_stream
=
p_sys
->
AnalyseAllSegmentsFound
(
p_estream
);
if
(
p_stream
==
NULL
)
{
msg_Dbg
(
p_demux
,
"the file '%s' will not be used"
,
s_filename
.
c_str
()
);
delete
p_estream
;
delete
p_file_io
;
}
else
{
p_stream
->
p_in
=
p_file_io
;
p_stream
->
p_es
=
p_estream
;
p_sys
->
streams
.
push_back
(
p_stream
);
}
}
}
}
...
...
@@ -1398,9 +1406,8 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, mtime_t i_pts,
#undef tk
}
bool
demux_sys_t
::
AnalyseAllSegmentsFound
(
EbmlStream
*
p_estream
)
matroska_stream_t
*
demux_sys_t
::
AnalyseAllSegmentsFound
(
EbmlStream
*
p_estream
)
{
return
false
;
// FIXME safer until this thing works
int
i_upper_lvl
=
0
;
size_t
i
;
EbmlElement
*
p_l0
,
*
p_l1
,
*
p_l2
;
...
...
@@ -1410,7 +1417,7 @@ return false; // FIXME safer until this thing works
p_l0
=
p_estream
->
FindNextID
(
EbmlHead
::
ClassInfos
,
0xFFFFFFFFL
);
if
(
p_l0
==
NULL
)
{
return
false
;
return
NULL
;
}
matroska_stream_t
*
p_stream1
=
new
matroska_stream_t
(
*
this
);
...
...
@@ -1436,6 +1443,7 @@ return false; // FIXME safer until this thing works
ep
=
new
EbmlParser
(
p_estream
,
p_l0
);
p_segment1
->
ep
=
ep
;
p_segment1
->
segment
=
(
KaxSegment
*
)
p_l0
;
while
((
p_l1
=
ep
->
Get
()))
{
...
...
@@ -1485,16 +1493,16 @@ return false; // FIXME safer until this thing works
}
p_l0
->
SkipData
(
*
p_estream
,
EbmlHead_Context
);
delete
p_l0
;
p_l0
=
p_estream
->
FindNextID
(
KaxSegment
::
ClassInfos
,
0xFFFFFFFFL
);
}
if
(
b_keep_stream
)
streams
.
push_back
(
p_stream1
);
else
if
(
!
b_keep_stream
)
{
delete
p_stream1
;
p_stream1
=
NULL
;
}
return
b_keep_stream
;
return
p_stream1
;
}
static
void
UpdateCurrentToChapter
(
demux_t
&
demux
)
...
...
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