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
760a9754
Commit
760a9754
authored
May 25, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2dec: support seeking with ts_from_file
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a753776f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
img2dec.c
libavformat/img2dec.c
+10
-2
No files found.
libavformat/img2dec.c
View file @
760a9754
...
...
@@ -393,6 +393,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if
(
stat
(
filename
,
&
img_stat
))
return
AVERROR
(
EIO
);
pkt
->
pts
=
(
int64_t
)
img_stat
.
st_mtime
;
av_add_index_entry
(
s1
->
streams
[
0
],
s
->
img_number
,
pkt
->
pts
,
0
,
0
,
AVINDEX_KEYFRAME
);
}
else
if
(
!
s
->
is_pipe
)
{
pkt
->
pts
=
s
->
pts
;
}
...
...
@@ -433,8 +434,15 @@ static int img_read_close(struct AVFormatContext* s1)
static
int
img_read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
timestamp
,
int
flags
)
{
VideoDemuxData
*
s1
=
s
->
priv_data
;
if
(
s1
->
ts_from_file
)
/* Seeking is not supported in this case */
return
AVERROR
(
ESPIPE
);
AVStream
*
st
=
s
->
streams
[
0
];
if
(
s1
->
ts_from_file
)
{
int
index
=
av_index_search_timestamp
(
st
,
timestamp
,
flags
);
if
(
index
<
0
)
return
-
1
;
s1
->
img_number
=
st
->
index_entries
[
index
].
pos
;
return
0
;
}
if
(
timestamp
<
0
||
!
s1
->
loop
&&
timestamp
>
s1
->
img_last
-
s1
->
img_first
)
return
-
1
;
...
...
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