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
0fafbb87
Commit
0fafbb87
authored
Feb 11, 2013
by
Denis Charmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Free unused resources when using linked mkvs
parent
062b8861
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
modules/demux/mkv/demux.cpp
modules/demux/mkv/demux.cpp
+32
-0
modules/demux/mkv/demux.hpp
modules/demux/mkv/demux.hpp
+1
-0
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.cpp
+2
-0
No files found.
modules/demux/mkv/demux.cpp
View file @
0fafbb87
...
@@ -713,6 +713,38 @@ bool demux_sys_t::PreloadLinked()
...
@@ -713,6 +713,38 @@ bool demux_sys_t::PreloadLinked()
return
true
;
return
true
;
}
}
void
demux_sys_t
::
FreeUnused
()
{
size_t
i
;
for
(
i
=
0
;
i
<
streams
.
size
();
i
++
)
{
bool
used
=
false
;
struct
matroska_stream_c
*
p_s
=
streams
[
i
];
for
(
size_t
j
=
0
;
j
<
p_s
->
segments
.
size
();
j
++
)
{
if
(
p_s
->
segments
[
j
]
->
b_preloaded
)
{
used
=
true
;
break
;
}
}
if
(
!
used
)
{
streams
[
i
]
=
NULL
;
delete
p_s
;
}
}
for
(
i
=
0
;
i
<
opened_segments
.
size
();
i
++
)
{
if
(
!
opened_segments
[
i
]
->
b_preloaded
)
{
delete
opened_segments
[
i
];
opened_segments
[
i
]
=
NULL
;
}
}
}
virtual_segment_c
*
demux_sys_t
::
VirtualFromSegments
(
std
::
vector
<
matroska_segment_c
*>
*
p_segments
)
const
virtual_segment_c
*
demux_sys_t
::
VirtualFromSegments
(
std
::
vector
<
matroska_segment_c
*>
*
p_segments
)
const
{
{
if
(
p_segments
->
empty
()
)
if
(
p_segments
->
empty
()
)
...
...
modules/demux/mkv/demux.hpp
View file @
0fafbb87
...
@@ -382,6 +382,7 @@ public:
...
@@ -382,6 +382,7 @@ public:
void
PreloadFamily
(
const
matroska_segment_c
&
of_segment
);
void
PreloadFamily
(
const
matroska_segment_c
&
of_segment
);
bool
PreloadLinked
();
bool
PreloadLinked
();
void
FreeUnused
();
bool
PreparePlayback
(
virtual_segment_c
*
p_new_segment
);
bool
PreparePlayback
(
virtual_segment_c
*
p_new_segment
);
matroska_stream_c
*
AnalyseAllSegmentsFound
(
demux_t
*
p_demux
,
EbmlStream
*
p_estream
,
bool
b_initial
=
false
);
matroska_stream_c
*
AnalyseAllSegmentsFound
(
demux_t
*
p_demux
,
EbmlStream
*
p_estream
,
bool
b_initial
=
false
);
void
JumpTo
(
virtual_segment_c
&
p_segment
,
virtual_chapter_c
*
p_chapter
);
void
JumpTo
(
virtual_segment_c
&
p_segment
,
virtual_chapter_c
*
p_chapter
);
...
...
modules/demux/mkv/mkv.cpp
View file @
0fafbb87
...
@@ -247,6 +247,8 @@ static int Open( vlc_object_t * p_this )
...
@@ -247,6 +247,8 @@ static int Open( vlc_object_t * p_this )
goto
error
;
goto
error
;
}
}
p_sys
->
FreeUnused
();
p_sys
->
InitUi
();
p_sys
->
InitUi
();
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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