Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
0c84bbed
Commit
0c84bbed
authored
Feb 17, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: finer granularity for seeking (useful for long files)
parent
7c07687a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+9
-9
No files found.
modules/demux/mkv.cpp
View file @
0c84bbed
...
...
@@ -132,7 +132,7 @@ vlc_module_end();
*****************************************************************************/
static
int
Demux
(
demux_t
*
);
static
int
Control
(
demux_t
*
,
int
,
va_list
);
static
void
Seek
(
demux_t
*
,
mtime_t
i_date
,
int
i
_percent
);
static
void
Seek
(
demux_t
*
,
mtime_t
i_date
,
double
f
_percent
);
#ifdef HAVE_ZLIB_H
block_t
*
block_zlib_decompress
(
vlc_object_t
*
p_this
,
block_t
*
p_in_block
)
{
...
...
@@ -1092,7 +1092,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_SET_POSITION
:
f
=
(
double
)
va_arg
(
args
,
double
);
Seek
(
p_demux
,
-
1
,
(
int
)(
100.0
*
f
)
);
Seek
(
p_demux
,
-
1
,
f
);
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
...
...
@@ -1378,7 +1378,7 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, mtime_t i_pts,
#undef tk
}
static
void
Seek
(
demux_t
*
p_demux
,
mtime_t
i_date
,
int
i
_percent
)
static
void
Seek
(
demux_t
*
p_demux
,
mtime_t
i_date
,
double
f
_percent
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
...
...
@@ -1391,27 +1391,27 @@ static void Seek( demux_t *p_demux, mtime_t i_date, int i_percent)
int
i_track_skipping
;
int
i_track
;
msg_Dbg
(
p_demux
,
"seek request to "
I64Fd
" (%
d%%)"
,
i_date
,
i
_percent
);
if
(
i_date
<
0
&&
i
_percent
<
0
)
msg_Dbg
(
p_demux
,
"seek request to "
I64Fd
" (%
f%%)"
,
i_date
,
f
_percent
);
if
(
i_date
<
0
&&
f
_percent
<
0
)
{
return
;
}
if
(
i_percent
>
100
)
i_percent
=
10
0
;
if
(
f_percent
>
1.0
)
f_percent
=
1.
0
;
delete
p_sys
->
ep
;
p_sys
->
ep
=
new
EbmlParser
(
p_sys
->
es
,
p_sys
->
segment
);
p_sys
->
cluster
=
NULL
;
/* seek without index or without date */
if
(
i
_percent
>=
0
&&
(
config_GetInt
(
p_demux
,
"mkv-seek-percent"
)
||
!
p_sys
->
b_cues
||
i_date
<
0
))
if
(
f
_percent
>=
0
&&
(
config_GetInt
(
p_demux
,
"mkv-seek-percent"
)
||
!
p_sys
->
b_cues
||
i_date
<
0
))
{
if
(
p_sys
->
f_duration
>=
0
)
{
i_date
=
i_percent
*
p_sys
->
f_duration
*
1
0
;
i_date
=
f_percent
*
p_sys
->
f_duration
*
100
0
;
}
else
{
int64_t
i_pos
=
i_percent
*
stream_Size
(
p_demux
->
s
)
/
100
;
int64_t
i_pos
=
f_percent
*
stream_Size
(
p_demux
->
s
)
;
msg_Dbg
(
p_demux
,
"inacurate way of seeking"
);
for
(
i_index
=
0
;
i_index
<
p_sys
->
i_index
;
i_index
++
)
...
...
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