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
df0b9f55
Commit
df0b9f55
authored
Sep 04, 2012
by
Denis Charmet
Committed by
Jean-Baptiste Kempf
Sep 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MKV: Handle multi-editions as different titles
Close #7401 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
720f0f1b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
modules/demux/mkv/demux.cpp
modules/demux/mkv/demux.cpp
+12
-13
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.cpp
+9
-5
No files found.
modules/demux/mkv/demux.cpp
View file @
df0b9f55
...
...
@@ -652,19 +652,20 @@ bool demux_sys_t::PreloadLinked()
{
p_seg
=
used_segments
[
i
];
if
(
p_seg
->
Editions
()
!=
NULL
)
{
for
(
j
=
0
;
j
<
p_seg
->
Editions
()
->
size
();
j
++
)
{
input_title_t
*
p_title
=
vlc_input_title_New
();
p_seg
->
i_sys_title
=
i
;
int
i_chapters
;
// TODO use a name for each edition, let the TITLE deal with a codec name
for
(
j
=
0
;
j
<
p_seg
->
Editions
()
->
size
();
j
++
)
{
if
(
p_title
->
psz_name
==
NULL
)
{
const
char
*
psz_tmp
=
(
*
p_seg
->
Editions
())[
j
]
->
GetMainName
().
c_str
();
if
(
*
psz_tmp
!=
'\0'
)
p_title
->
psz_name
=
strdup
(
psz_tmp
);
else
if
(
asprintf
(
&
(
p_title
->
psz_name
),
"%s %d"
,
N_
(
"Segment"
),
(
int
)
i
)
==
-
1
)
p_title
->
psz_name
=
NULL
;
}
i_chapters
=
0
;
...
...
@@ -672,18 +673,12 @@ bool demux_sys_t::PreloadLinked()
// Input duration into i_length
p_title
->
i_length
=
(
*
p_seg
->
Editions
()
)[
j
]
->
i_duration
;
}
// create a name if there is none
if
(
p_title
->
psz_name
==
NULL
)
{
if
(
asprintf
(
&
(
p_title
->
psz_name
),
"%s %d"
,
N_
(
"Segment"
),
(
int
)
i
)
==
-
1
)
p_title
->
psz_name
=
NULL
;
}
titles
.
push_back
(
p_title
);
}
}
p_seg
->
i_sys_title
=
p_seg
->
i_current_edition
;
}
// TODO decide which segment should be first used (VMG for DVD)
...
...
@@ -719,6 +714,10 @@ bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_segment )
p_current_segment
->
CurrentSegment
()
->
InformationCreate
(
);
p_current_segment
->
CurrentSegment
()
->
Select
(
0
);
/* Seek to the beginning */
p_current_segment
->
Seek
(
p_current_segment
->
CurrentSegment
()
->
sys
.
demuxer
,
0
,
0
,
NULL
,
-
1
);
return
true
;
}
...
...
modules/demux/mkv/mkv.cpp
View file @
df0b9f55
...
...
@@ -355,19 +355,23 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
*
ppp_title
=
(
input_title_t
**
)
malloc
(
sizeof
(
input_title_t
**
)
*
p_sys
->
titles
.
size
()
);
for
(
size_t
i
=
0
;
i
<
p_sys
->
titles
.
size
();
i
++
)
{
(
*
ppp_title
)[
i
]
=
vlc_input_title_Duplicate
(
p_sys
->
titles
[
i
]
);
}
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_SET_TITLE
:
/*
TODO
handle editions as titles */
/* handle editions as titles */
i_idx
=
(
int
)
va_arg
(
args
,
int
);
if
(
i_idx
<
p_sys
->
used_segments
.
size
()
)
if
(
i_idx
<
p_sys
->
titles
.
size
()
&&
p_sys
->
titles
[
i_idx
]
->
i_seekpoint
)
{
p_sys
->
JumpTo
(
*
p_sys
->
used_segments
[
i_idx
],
NULL
);
p_sys
->
p_current_segment
->
i_current_edition
=
i_idx
;
p_sys
->
i_current_title
=
i_idx
;
p_sys
->
p_current_segment
->
p_current_chapter
=
p_sys
->
p_current_segment
->
editions
[
p_sys
->
p_current_segment
->
i_current_edition
]
->
getChapterbyTimecode
(
0
);
Seek
(
p_demux
,
(
int64_t
)
p_sys
->
titles
[
i_idx
]
->
seekpoint
[
0
]
->
i_time_offset
,
-
1
,
NULL
);
p_demux
->
info
.
i_seekpoint
|=
INPUT_UPDATE_SEEKPOINT
;
p_demux
->
info
.
i_seekpoint
=
0
;
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
...
...
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