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
adf378a9
Commit
adf378a9
authored
Dec 03, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: asf: wait keyframe on index seek too
Index could be post keyframe type !
parent
e52ce3a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+34
-7
No files found.
modules/demux/asf/asf.c
View file @
adf378a9
...
...
@@ -229,11 +229,30 @@ static void Close( vlc_object_t * p_this )
}
/*****************************************************************************
*
SeekIndex: goto to i_date or i_percent
*
WaitKeyframe: computes the number of frames to wait for a keyframe
*****************************************************************************/
static
int
SeekPercent
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
static
void
WaitKeyframe
(
demux_t
*
p_demux
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
if
(
!
p_sys
->
i_seek_track
)
{
for
(
int
i
=
0
;
i
<
128
;
i
++
)
{
asf_track_t
*
tk
=
p_sys
->
track
[
i
];
if
(
tk
&&
tk
->
p_sp
&&
tk
->
i_cat
==
VIDEO_ES
)
{
bool
b_selected
=
false
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_GET_ES_STATE
,
tk
->
p_es
,
&
b_selected
);
if
(
b_selected
)
{
p_sys
->
i_seek_track
=
tk
->
p_sp
->
i_stream_number
;
break
;
}
}
}
}
if
(
p_sys
->
i_seek_track
)
{
/* Skip forward at least 1 min */
...
...
@@ -255,6 +274,18 @@ static int SeekPercent( demux_t *p_demux, int i_query, va_list args )
{
p_sys
->
i_wait_keyframe
=
0
;
}
}
/*****************************************************************************
* SeekIndex: goto to i_date or i_percent
*****************************************************************************/
static
int
SeekPercent
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
WaitKeyframe
(
p_demux
);
msg_Dbg
(
p_demux
,
"seek with percent: waiting %i frames"
,
p_sys
->
i_wait_keyframe
);
return
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_data_begin
,
p_sys
->
i_data_end
,
p_sys
->
i_bitrate
,
...
...
@@ -282,7 +313,7 @@ static int SeekIndex( demux_t *p_demux, mtime_t i_date, float f_pos )
return
VLC_EGENERIC
;
}
p_sys
->
i_wait_keyframe
=
p_sys
->
i_seek_track
?
50
:
0
;
WaitKeyframe
(
p_demux
)
;
uint64_t
i_offset
=
(
uint64_t
)
p_index
->
index_entry
[
i_entry
].
i_packet_number
*
p_sys
->
p_fp
->
i_min_data_packet_size
;
...
...
@@ -1171,10 +1202,6 @@ static int DemuxInit( demux_t *p_demux )
*
p
=
'\0'
;
}
/* Set the track on which we'll do our seeking to the first video track */
if
(
!
p_sys
->
i_seek_track
&&
fmt
.
i_cat
==
VIDEO_ES
)
p_sys
->
i_seek_track
=
p_sp
->
i_stream_number
;
/* Set our priority so we won't get multiple videos */
int
i_priority
=
ES_PRIORITY_SELECTABLE_MIN
;
for
(
int16_t
i
=
0
;
i
<
fmt_priorities_ex
.
i_count
;
i
++
)
...
...
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