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
04ac1706
Commit
04ac1706
authored
Jan 06, 2011
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux/asf: make sure we seek to keyframes
parent
2636de44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+23
-1
No files found.
modules/demux/asf/asf.c
View file @
04ac1706
...
...
@@ -95,7 +95,10 @@ struct demux_sys_t
int64_t
i_data_begin
;
int64_t
i_data_end
;
bool
b_index
;
bool
b_index
;
unsigned
int
i_seek_track
;
unsigned
int
i_wait_keyframe
;
vlc_meta_t
*
meta
;
};
...
...
@@ -228,6 +231,7 @@ static void Close( vlc_object_t * p_this )
static
int
SeekPercent
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
p_sys
->
i_wait_keyframe
=
p_sys
->
i_seek_track
?
50
:
0
;
return
demux_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_data_begin
,
p_sys
->
i_data_end
,
p_sys
->
i_bitrate
,
p_sys
->
p_fp
->
i_min_data_packet_size
,
...
...
@@ -254,6 +258,8 @@ 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
;
uint64_t
i_offset
=
(
uint64_t
)
p_index
->
index_entry
[
i_entry
].
i_packet_number
*
p_sys
->
p_fp
->
i_min_data_packet_size
;
return
stream_Seek
(
p_demux
->
s
,
p_sys
->
i_data_begin
+
i_offset
);
...
...
@@ -580,6 +586,16 @@ static int DemuxPacket( demux_t *p_demux )
continue
;
// over payload
}
if
(
p_sys
->
i_wait_keyframe
&&
!
(
i_stream_number
==
p_sys
->
i_seek_track
&&
i_packet_keyframe
&&
!
i_media_object_offset
)
)
{
i_skip
+=
i_payload_data_length
;
p_sys
->
i_wait_keyframe
--
;
continue
;
// over payload
}
p_sys
->
i_wait_keyframe
=
0
;
if
(
!
tk
->
p_es
)
{
i_skip
+=
i_payload_data_length
;
...
...
@@ -712,6 +728,8 @@ static int DemuxInit( demux_t *p_demux )
p_sys
->
p_fp
=
NULL
;
p_sys
->
b_index
=
0
;
p_sys
->
i_track
=
0
;
p_sys
->
i_seek_track
=
0
;
p_sys
->
i_wait_keyframe
=
0
;
for
(
int
i
=
0
;
i
<
128
;
i
++
)
{
p_sys
->
track
[
i
]
=
NULL
;
...
...
@@ -978,6 +996,10 @@ 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
;
tk
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
}
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