Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c7bd5eda
Commit
c7bd5eda
authored
May 12, 2011
by
Vladimir Pantelic
Committed by
Reinhard Tartler
May 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asfdec: fallback to binary search internally
lavf will do that anyway in case seek by index fails
parent
4bac1bbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
asfdec.c
libavformat/asfdec.c
+8
-7
No files found.
libavformat/asfdec.c
View file @
c7bd5eda
...
@@ -1269,21 +1269,22 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
...
@@ -1269,21 +1269,22 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
if
(
!
asf
->
index_read
)
if
(
!
asf
->
index_read
)
asf_build_simple_index
(
s
,
stream_index
);
asf_build_simple_index
(
s
,
stream_index
);
if
(
!
(
asf
->
index_read
&&
st
->
index_entries
)){
if
((
asf
->
index_read
&&
st
->
index_entries
)){
if
(
av_seek_frame_binary
(
s
,
stream_index
,
pts
,
flags
)
<
0
)
return
-
1
;
}
else
{
index
=
av_index_search_timestamp
(
st
,
pts
,
flags
);
index
=
av_index_search_timestamp
(
st
,
pts
,
flags
);
if
(
index
<
0
)
if
(
index
>=
0
)
{
return
-
1
;
/* find the position */
/* find the position */
pos
=
st
->
index_entries
[
index
].
pos
;
pos
=
st
->
index_entries
[
index
].
pos
;
/* do the seek */
/* do the seek */
av_log
(
s
,
AV_LOG_DEBUG
,
"SEEKTO: %"
PRId64
"
\n
"
,
pos
);
av_log
(
s
,
AV_LOG_DEBUG
,
"SEEKTO: %"
PRId64
"
\n
"
,
pos
);
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
);
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
);
asf_reset_header
(
s
);
return
0
;
}
}
}
/* no index or seeking by index failed */
if
(
av_seek_frame_binary
(
s
,
stream_index
,
pts
,
flags
)
<
0
)
return
-
1
;
asf_reset_header
(
s
);
asf_reset_header
(
s
);
return
0
;
return
0
;
}
}
...
...
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