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
1a206bf5
Commit
1a206bf5
authored
Feb 18, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: handle seeking the way it's supposed to work (in the future)
parent
70944c2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+20
-14
No files found.
modules/demux/mkv.cpp
View file @
1a206bf5
...
...
@@ -1087,10 +1087,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_GET_POSITION
:
pf
=
(
double
*
)
va_arg
(
args
,
double
*
);
if
(
p_sys
->
i_pts
<
p_sys
->
i_start_pts
)
*
pf
=
(
double
)
p_sys
->
i_start_pts
/
(
1000.0
*
p_sys
->
f_duration
);
else
*
pf
=
(
double
)
p_sys
->
i_pts
/
(
1000.0
*
p_sys
->
f_duration
);
/*
if (p_sys->i_pts < p_sys->i_start_pts)
*pf = (double)p_sys->i_start_pts / (1000.0 * p_sys->f_duration);
else*/
*
pf
=
(
double
)
p_sys
->
i_pts
/
(
1000.0
*
p_sys
->
f_duration
);
return
VLC_SUCCESS
;
case
DEMUX_SET_POSITION
:
...
...
@@ -1100,10 +1100,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_pts
<
p_sys
->
i_start_pts
)
*
pi64
=
p_sys
->
i_start_pts
;
else
*
pi64
=
p_sys
->
i_pts
;
/*
if (p_sys->i_pts < p_sys->i_start_pts)
*pi64 = p_sys->i_start_pts;
else*/
*
pi64
=
p_sys
->
i_pts
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TITLE_INFO
:
...
...
@@ -1312,6 +1312,10 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, mtime_t i_pts,
msg_Err
(
p_demux
,
"unknown track number=%d"
,
block
->
TrackNum
()
);
return
;
}
if
(
i_pts
<
p_sys
->
i_start_pts
&&
tk
.
fmt
.
i_cat
==
AUDIO_ES
)
{
return
;
/* discard audio packets that shouldn't be rendered */
}
es_out_Control
(
p_demux
->
out
,
ES_OUT_GET_ES_STATE
,
tk
.
p_es
,
&
b
);
if
(
!
b
)
...
...
@@ -1351,11 +1355,12 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, mtime_t i_pts,
}
#endif
/* if (p_sys->i_start_pts > i_pts)
{
p_block->i_dts = p_block->i_pts = -1;
}
else*/
if
(
p_sys
->
i_start_pts
>
i_pts
)
{
p_block
->
i_dts
=
0
;
p_block
->
i_pts
=
-
1
;
}
else
if
(
tk
.
fmt
.
i_cat
!=
VIDEO_ES
)
{
p_block
->
i_dts
=
p_block
->
i_pts
=
i_pts
;
...
...
@@ -1500,6 +1505,8 @@ static void Seek( demux_t *p_demux, mtime_t i_date, double f_percent)
p_sys
->
i_start_pts
=
i_date
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_RESET_PCR
);
while
(
i_track_skipping
>
0
)
{
if
(
BlockGet
(
p_demux
,
&
block
,
&
i_block_ref1
,
&
i_block_ref2
,
&
i_block_duration
)
)
...
...
@@ -1531,7 +1538,6 @@ static void Seek( demux_t *p_demux, mtime_t i_date, double f_percent)
if
(
!
tk
.
b_search_keyframe
)
{
BlockDecode
(
p_demux
,
block
,
0
,
0
);
/* es_out_Control( p_demux->out, ES_OUT_SET_PCR, block->GlobalTimecode() / (mtime_t) 1000 );*/
}
}
}
...
...
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