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
b2ef4197
Commit
b2ef4197
authored
May 30, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve seek precision using ES_OUT_SET_NEXT_DISPLAY_TIME.
(Please report any 'seek' regression)
parent
a82a5094
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
32 deletions
+14
-32
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+14
-32
No files found.
modules/demux/avi/avi.c
View file @
b2ef4197
...
@@ -405,6 +405,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -405,6 +405,7 @@ static int Open( vlc_object_t * p_this )
fmt
.
i_bitrate
=
p_auds
->
p_wf
->
nAvgBytesPerSec
*
8
;
fmt
.
i_bitrate
=
p_auds
->
p_wf
->
nAvgBytesPerSec
*
8
;
fmt
.
audio
.
i_blockalign
=
p_auds
->
p_wf
->
nBlockAlign
;
fmt
.
audio
.
i_blockalign
=
p_auds
->
p_wf
->
nBlockAlign
;
fmt
.
audio
.
i_bitspersample
=
p_auds
->
p_wf
->
wBitsPerSample
;
fmt
.
audio
.
i_bitspersample
=
p_auds
->
p_wf
->
wBitsPerSample
;
fmt
.
b_packetized
=
!
tk
->
i_blocksize
;
fmt
.
i_extra
=
__MIN
(
p_auds
->
p_wf
->
cbSize
,
fmt
.
i_extra
=
__MIN
(
p_auds
->
p_wf
->
cbSize
,
p_auds
->
i_chunk_size
-
sizeof
(
WAVEFORMATEX
)
);
p_auds
->
i_chunk_size
-
sizeof
(
WAVEFORMATEX
)
);
fmt
.
p_extra
=
&
p_auds
->
p_wf
[
1
];
fmt
.
p_extra
=
&
p_auds
->
p_wf
[
1
];
...
@@ -1272,41 +1273,18 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
...
@@ -1272,41 +1273,18 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
msg_Dbg
(
p_demux
,
"estimate date "
I64Fd
,
i_date
);
msg_Dbg
(
p_demux
,
"estimate date "
I64Fd
,
i_date
);
}
}
#define p_stream p_sys->track[i_stream]
/* */
p_sys
->
i_time
=
0
;
/* seek for chunk based streams */
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_track
;
i_stream
++
)
{
if
(
p_stream
->
b_activated
&&
!
p_stream
->
i_samplesize
)
/* if( p_stream->b_activated ) */
{
AVI_TrackSeek
(
p_demux
,
i_stream
,
i_date
);
p_sys
->
i_time
=
__MAX
(
AVI_GetPTS
(
p_stream
),
p_sys
->
i_time
);
}
}
#if 1
if
(
p_sys
->
i_time
)
{
i_date
=
p_sys
->
i_time
;
}
/* seek for bytes based streams */
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_track
;
i_stream
++
)
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_track
;
i_stream
++
)
{
{
if
(
p_stream
->
b_activated
&&
p_stream
->
i_samplesize
)
avi_track_t
*
p_stream
=
p_sys
->
track
[
i_stream
];
{
if
(
!
p_stream
->
b_activated
)
continue
;
AVI_TrackSeek
(
p_demux
,
i_stream
,
i_date
);
AVI_TrackSeek
(
p_demux
,
i_stream
,
i_date
);
/* p_sys->i_time = __MAX( AVI_GetPTS( p_stream ), p_sys->i_time );*/
}
}
}
msg_Dbg
(
p_demux
,
"seek: "
I64Fd
" seconds"
,
p_sys
->
i_time
/
1000000
);
/* set true movie time */
#endif
if
(
!
p_sys
->
i_time
)
{
p_sys
->
i_time
=
i_date
;
p_sys
->
i_time
=
i_date
;
}
msg_Dbg
(
p_demux
,
"seek: "
I64Fd
" seconds"
,
p_sys
->
i_time
/
1000000
);
#undef p_stream
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
else
else
...
@@ -1722,7 +1700,7 @@ static int AVI_TrackSeek( demux_t *p_demux,
...
@@ -1722,7 +1700,7 @@ static int AVI_TrackSeek( demux_t *p_demux,
if
(
p_stream
->
i_cat
==
VIDEO_ES
)
if
(
p_stream
->
i_cat
==
VIDEO_ES
)
{
{
/* search key frame */
/* search key frame */
if
(
i_date
<
i_oldpts
)
//if( i_date < i_oldpts || 1
)
{
{
while
(
p_stream
->
i_idxposc
>
0
&&
while
(
p_stream
->
i_idxposc
>
0
&&
!
(
p_stream
->
p_index
[
p_stream
->
i_idxposc
].
i_flags
&
!
(
p_stream
->
p_index
[
p_stream
->
i_idxposc
].
i_flags
&
...
@@ -1735,7 +1713,10 @@ static int AVI_TrackSeek( demux_t *p_demux,
...
@@ -1735,7 +1713,10 @@ static int AVI_TrackSeek( demux_t *p_demux,
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
}
if
(
p_stream
->
p_es
)
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_NEXT_DISPLAY_TIME
,
p_stream
->
p_es
,
i_date
);
}
}
#if 0
else
else
{
{
while( p_stream->i_idxposc < p_stream->i_idxnb &&
while( p_stream->i_idxposc < p_stream->i_idxnb &&
...
@@ -1750,6 +1731,7 @@ static int AVI_TrackSeek( demux_t *p_demux,
...
@@ -1750,6 +1731,7 @@ static int AVI_TrackSeek( demux_t *p_demux,
}
}
}
}
}
}
#endif
}
}
}
}
else
else
...
...
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