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
0a6b059e
Commit
0a6b059e
authored
Mar 16, 2015
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Mar 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MKV: fix mixup between VLC timestamps and Matroska timestamps
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
bf6f6714
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
17 deletions
+19
-17
modules/demux/mkv/demux.hpp
modules/demux/mkv/demux.hpp
+3
-3
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+8
-8
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.cpp
+4
-3
modules/demux/mkv/virtual_segment.cpp
modules/demux/mkv/virtual_segment.cpp
+4
-3
No files found.
modules/demux/mkv/demux.hpp
View file @
0a6b059e
...
...
@@ -331,9 +331,9 @@ struct demux_sys_t
public:
demux_sys_t
(
demux_t
&
demux
)
:
demuxer
(
demux
)
,
i_pts
(
0
)
,
i_pcr
(
0
)
,
i_start_pts
(
0
)
,
i_pts
(
VLC_TS_INVALID
)
,
i_pcr
(
VLC_TS_INVALID
)
,
i_start_pts
(
VLC_TS_
0
)
,
i_chapter_time
(
0
)
,
meta
(
NULL
)
,
i_current_title
(
0
)
...
...
modules/demux/mkv/matroska_segment.cpp
View file @
0a6b059e
...
...
@@ -942,9 +942,9 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
ep
=
new
EbmlParser
(
&
es
,
segment
,
&
sys
.
demuxer
,
var_InheritBool
(
&
sys
.
demuxer
,
"mkv-use-dummy"
)
);
cluster
=
NULL
;
sys
.
i_start_pts
=
0
;
sys
.
i_pts
=
0
;
sys
.
i_pcr
=
0
;
sys
.
i_start_pts
=
VLC_TS_
0
;
sys
.
i_pts
=
VLC_TS_INVALID
;
sys
.
i_pcr
=
VLC_TS_
0
;
return
;
}
...
...
@@ -972,7 +972,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
var_InheritBool
(
&
sys
.
demuxer
,
"mkv-use-dummy"
)
);
cluster
=
NULL
;
sys
.
i_start_pts
=
i_date
;
sys
.
i_start_pts
=
i_date
+
VLC_TS_0
;
/* now parse until key frame */
const
int
es_types
[
3
]
=
{
VIDEO_ES
,
AUDIO_ES
,
SPU_ES
};
...
...
@@ -1024,7 +1024,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
/*Neither video nor audio track... no seek further*/
if
(
unlikely
(
!
p_first
)
)
{
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_PCR
,
i_date
);
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_PCR
,
i_date
+
VLC_TS_0
);
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_date
);
return
;
}
...
...
@@ -1101,8 +1101,8 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
if
(
p_last
->
i_date
<
p_min
->
i_date
)
p_min
=
p_last
;
sys
.
i_pcr
=
sys
.
i_pts
=
p_min
->
i_date
;
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_PCR
,
VLC_TS_0
+
sys
.
i_pcr
);
sys
.
i_pcr
=
sys
.
i_pts
=
p_min
->
i_date
+
VLC_TS_0
;
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_PCR
,
sys
.
i_pcr
);
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_date
);
cluster
=
(
KaxCluster
*
)
ep
->
UnGet
(
p_min
->
i_seek_pos
,
p_min
->
i_cluster_pos
);
...
...
@@ -1338,7 +1338,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
}
es_out_Control
(
sys
.
demuxer
.
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
i_start_time
);
sys
.
i_start_pts
=
i_start_time
;
sys
.
i_start_pts
=
i_start_time
+
VLC_TS_0
;
// reset the stream reading to the first cluster of the segment used
es
.
I_O
().
setFilePointer
(
i_start_pos
);
...
...
modules/demux/mkv/mkv.cpp
View file @
0a6b059e
...
...
@@ -757,7 +757,7 @@ static int Demux( demux_t *p_demux)
{
/* TODO handle successive chapters with the same user_start_time/user_end_time
*/
p_sys
->
i_pts
=
p_chap
->
i_virtual_stop_time
;
p_sys
->
i_pts
=
p_chap
->
i_virtual_stop_time
+
VLC_TS_0
;
p_sys
->
i_pts
++
;
// trick to avoid staying on segments with no duration and no content
i_return
=
1
;
...
...
@@ -773,9 +773,10 @@ static int Demux( demux_t *p_demux)
}
if
(
simpleblock
!=
NULL
)
p_sys
->
i_pts
=
p_sys
->
i_chapter_time
+
(
(
mtime_t
)
simpleblock
->
GlobalTimecode
()
/
INT64_C
(
1000
)
);
p_sys
->
i_pts
=
(
mtime_t
)
simpleblock
->
GlobalTimecode
()
/
INT64_C
(
1000
);
else
p_sys
->
i_pts
=
p_sys
->
i_chapter_time
+
(
(
mtime_t
)
block
->
GlobalTimecode
()
/
INT64_C
(
1000
)
);
p_sys
->
i_pts
=
(
mtime_t
)
block
->
GlobalTimecode
()
/
INT64_C
(
1000
);
p_sys
->
i_pts
+=
p_sys
->
i_chapter_time
+
VLC_TS_0
;
mtime_t
i_pcr
=
VLC_TS_INVALID
;
for
(
size_t
i
=
0
;
i
<
p_segment
->
tracks
.
size
();
i
++
)
...
...
modules/demux/mkv/virtual_segment.cpp
View file @
0a6b059e
...
...
@@ -399,12 +399,13 @@ virtual_chapter_c* virtual_edition_c::getChapterbyTimecode( int64_t time )
bool
virtual_segment_c
::
UpdateCurrentToChapter
(
demux_t
&
demux
)
{
demux_sys_t
&
sys
=
*
demux
.
p_sys
;
virtual_chapter_c
*
p_cur_chapter
;
virtual_chapter_c
*
p_cur_chapter
=
NULL
;
virtual_edition_c
*
p_cur_edition
=
editions
[
i_current_edition
];
bool
b_has_seeked
=
false
;
p_cur_chapter
=
p_cur_edition
->
getChapterbyTimecode
(
sys
.
i_pts
);
if
(
sys
.
i_pts
!=
VLC_TS_INVALID
)
p_cur_chapter
=
p_cur_edition
->
getChapterbyTimecode
(
sys
.
i_pts
-
VLC_TS_0
);
/* we have moved to a new chapter */
if
(
p_cur_chapter
!=
NULL
&&
p_current_chapter
!=
p_cur_chapter
)
...
...
@@ -426,7 +427,7 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
return
true
;
}
}
sys
.
i_start_pts
=
p_cur_chapter
->
i_virtual_start_time
;
;
sys
.
i_start_pts
=
p_cur_chapter
->
i_virtual_start_time
+
VLC_TS_0
;
}
p_current_chapter
=
p_cur_chapter
;
...
...
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