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
2c172c17
Commit
2c172c17
authored
Apr 18, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed mkv seeking when simpleblock is used for video.
parent
b147e3fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
23 deletions
+25
-23
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+20
-17
modules/demux/mkv/matroska_segment.hpp
modules/demux/mkv/matroska_segment.hpp
+1
-1
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.cpp
+4
-5
No files found.
modules/demux/mkv/matroska_segment.cpp
View file @
2c172c17
...
...
@@ -612,8 +612,6 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
KaxSimpleBlock
*
simpleblock
;
int
i_track_skipping
;
int64_t
i_block_duration
;
int64_t
i_block_ref1
;
int64_t
i_block_ref2
;
size_t
i_track
;
int64_t
i_seek_position
=
i_start_pos
;
int64_t
i_seek_time
=
i_start_time
;
...
...
@@ -696,7 +694,9 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
while
(
i_track_skipping
>
0
)
{
if
(
BlockGet
(
block
,
simpleblock
,
&
i_block_ref1
,
&
i_block_ref2
,
&
i_block_duration
)
)
bool
b_key_picture
;
bool
b_discardable_picture
;
if
(
BlockGet
(
block
,
simpleblock
,
&
b_key_picture
,
&
b_discardable_picture
,
&
i_block_duration
)
)
{
msg_Warn
(
&
sys
.
demuxer
,
"cannot get block EOF?"
);
...
...
@@ -726,14 +726,14 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
}
else
if
(
tracks
[
i_track
]
->
fmt
.
i_cat
==
VIDEO_ES
)
{
if
(
i_block_ref1
==
0
&&
tracks
[
i_track
]
->
b_search_keyframe
)
if
(
b_key_picture
&&
tracks
[
i_track
]
->
b_search_keyframe
)
{
tracks
[
i_track
]
->
b_search_keyframe
=
false
;
i_track_skipping
--
;
}
if
(
!
tracks
[
i_track
]
->
b_search_keyframe
)
{
BlockDecode
(
&
sys
.
demuxer
,
block
,
simpleblock
,
sys
.
i_pts
,
0
,
i_block_ref1
>=
0
||
i_block_ref2
>
0
);
BlockDecode
(
&
sys
.
demuxer
,
block
,
simpleblock
,
sys
.
i_pts
,
0
,
b_key_picture
||
b_discardable_picture
);
}
}
}
...
...
@@ -1252,12 +1252,13 @@ void matroska_segment_c::UnSelect( )
ep
=
NULL
;
}
int
matroska_segment_c
::
BlockGet
(
KaxBlock
*
&
pp_block
,
KaxSimpleBlock
*
&
pp_simpleblock
,
int64_t
*
pi_ref1
,
int64_t
*
pi_ref2
,
int64_t
*
pi_duration
)
int
matroska_segment_c
::
BlockGet
(
KaxBlock
*
&
pp_block
,
KaxSimpleBlock
*
&
pp_simpleblock
,
bool
*
pb_key_picture
,
bool
*
pb_discardable_picture
,
int64_t
*
pi_duration
)
{
pp_simpleblock
=
NULL
;
pp_block
=
NULL
;
*
pi_ref1
=
0
;
*
pi_ref2
=
0
;
*
pb_key_picture
=
true
;
*
pb_discardable_picture
=
false
;
for
(
;;
)
{
...
...
@@ -1277,6 +1278,11 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
pp_block
=
NULL
;
continue
;
}
if
(
pp_simpleblock
!=
NULL
)
{
*
pb_key_picture
=
pp_simpleblock
->
IsKeyframe
();
*
pb_discardable_picture
=
pp_simpleblock
->
IsDiscardable
();
}
/* update the index */
#define idx p_indexes[i_index - 1]
...
...
@@ -1286,7 +1292,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
idx
.
i_time
=
pp_simpleblock
->
GlobalTimecode
()
/
(
mtime_t
)
1000
;
else
idx
.
i_time
=
(
*
pp_block
).
GlobalTimecode
()
/
(
mtime_t
)
1000
;
idx
.
b_key
=
*
p
i_ref1
==
0
?
true
:
fals
e
;
idx
.
b_key
=
*
p
b_key_pictur
e
;
}
#undef idx
return
VLC_SUCCESS
;
...
...
@@ -1400,14 +1406,11 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
KaxReferenceBlock
&
ref
=
*
(
KaxReferenceBlock
*
)
el
;
ref
.
ReadData
(
es
.
I_O
()
);
if
(
*
pi_ref1
==
0
)
{
*
pi_ref1
=
int64
(
ref
)
*
cluster
->
GlobalTimecodeScale
();
}
else
if
(
*
pi_ref2
==
0
)
{
*
pi_ref2
=
int64
(
ref
)
*
cluster
->
GlobalTimecodeScale
();
}
if
(
int64
(
ref
)
<
0
)
*
pb_key_picture
=
false
;
else
if
(
int64
(
ref
)
>
0
)
*
pb_discardable_picture
=
true
;
}
else
if
(
MKV_IS_ID
(
el
,
KaxClusterSilentTrackNumber
)
)
{
...
...
modules/demux/mkv/matroska_segment.hpp
View file @
2c172c17
...
...
@@ -148,7 +148,7 @@ public:
void
LoadTags
(
KaxTags
*
tags
);
void
InformationCreate
(
);
void
Seek
(
mtime_t
i_date
,
mtime_t
i_time_offset
,
int64_t
i_global_position
);
int
BlockGet
(
KaxBlock
*
&
,
KaxSimpleBlock
*
&
,
int64_t
*
,
int64_t
*
,
int64_t
*
);
int
BlockGet
(
KaxBlock
*
&
,
KaxSimpleBlock
*
&
,
bool
*
,
bool
*
,
int64_t
*
);
int
BlockFindTrackIndex
(
size_t
*
pi_track
,
const
KaxBlock
*
,
const
KaxSimpleBlock
*
);
...
...
modules/demux/mkv/mkv.cpp
View file @
2c172c17
...
...
@@ -673,10 +673,9 @@ static int Demux( demux_t *p_demux)
KaxBlock
*
block
;
KaxSimpleBlock
*
simpleblock
;
int64_t
i_block_duration
=
0
;
int64_t
i_block_ref1
;
int64_t
i_block_ref2
;
if
(
p_segment
->
BlockGet
(
block
,
simpleblock
,
&
i_block_ref1
,
&
i_block_ref2
,
&
i_block_duration
)
)
bool
b_key_picture
;
bool
b_discardable_picture
;
if
(
p_segment
->
BlockGet
(
block
,
simpleblock
,
&
b_key_picture
,
&
b_discardable_picture
,
&
i_block_duration
)
)
{
if
(
p_vsegment
->
Edition
()
&&
p_vsegment
->
Edition
()
->
b_ordered
)
{
...
...
@@ -760,7 +759,7 @@ static int Demux( demux_t *p_demux)
continue
;
}
BlockDecode
(
p_demux
,
block
,
simpleblock
,
p_sys
->
i_pts
,
i_block_duration
,
i_block_ref1
>=
0
||
i_block_ref2
>
0
);
BlockDecode
(
p_demux
,
block
,
simpleblock
,
p_sys
->
i_pts
,
i_block_duration
,
b_key_picture
||
b_discardable_picture
);
delete
block
;
i_block_count
++
;
...
...
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