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
f40d1739
Commit
f40d1739
authored
Sep 22, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify url_fseek()
Originally committed as revision 6316 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8e06f20a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
39 deletions
+24
-39
aviobuf.c
libavformat/aviobuf.c
+24
-39
No files found.
libavformat/aviobuf.c
View file @
f40d1739
...
...
@@ -106,56 +106,41 @@ void put_flush_packet(ByteIOContext *s)
offset_t
url_fseek
(
ByteIOContext
*
s
,
offset_t
offset
,
int
whence
)
{
offset_t
offset1
;
offset_t
pos
=
s
->
pos
-
(
s
->
write_flag
?
0
:
(
s
->
buf_end
-
s
->
buffer
));
if
(
whence
!=
SEEK_CUR
&&
whence
!=
SEEK_SET
)
return
-
EINVAL
;
if
(
whence
==
SEEK_CUR
)
{
offset1
=
pos
+
(
s
->
buf_ptr
-
s
->
buffer
);
if
(
offset
==
0
)
return
offset1
;
offset
+=
offset1
;
}
offset1
=
offset
-
pos
;
if
(
!
s
->
must_flush
&&
offset1
>=
0
&&
offset1
<
(
s
->
buf_end
-
s
->
buffer
))
{
/* can do the seek inside the buffer */
s
->
buf_ptr
=
s
->
buffer
+
offset1
;
}
else
{
if
(
!
s
->
seek
)
return
-
EPIPE
;
#ifdef CONFIG_MUXERS
if
(
s
->
write_flag
)
{
if
(
whence
==
SEEK_CUR
)
{
offset1
=
s
->
pos
+
(
s
->
buf_ptr
-
s
->
buffer
);
if
(
offset
==
0
)
return
offset1
;
offset
+=
offset1
;
}
offset1
=
offset
-
s
->
pos
;
if
(
!
s
->
must_flush
&&
offset1
>=
0
&&
offset1
<
(
s
->
buf_end
-
s
->
buffer
))
{
/* can do the seek inside the buffer */
s
->
buf_ptr
=
s
->
buffer
+
offset1
;
}
else
{
if
(
!
s
->
seek
)
return
-
EPIPE
;
if
(
s
->
write_flag
)
{
flush_buffer
(
s
);
s
->
must_flush
=
1
;
s
->
buf_ptr
=
s
->
buffer
;
s
->
seek
(
s
->
opaque
,
offset
,
SEEK_SET
);
s
->
pos
=
offset
;
}
}
else
}
else
#endif //CONFIG_MUXERS
{
if
(
whence
==
SEEK_CUR
)
{
offset1
=
s
->
pos
-
(
s
->
buf_end
-
s
->
buffer
)
+
(
s
->
buf_ptr
-
s
->
buffer
);
if
(
offset
==
0
)
return
offset1
;
offset
+=
offset1
;
}
offset1
=
offset
-
(
s
->
pos
-
(
s
->
buf_end
-
s
->
buffer
));
if
(
offset1
>=
0
&&
offset1
<=
(
s
->
buf_end
-
s
->
buffer
))
{
/* can do the seek inside the buffer */
s
->
buf_ptr
=
s
->
buffer
+
offset1
;
}
else
{
if
(
!
s
->
seek
)
return
-
EPIPE
;
s
->
buf_ptr
=
s
->
buffer
;
{
s
->
buf_end
=
s
->
buffer
;
if
(
s
->
seek
(
s
->
opaque
,
offset
,
SEEK_SET
)
==
(
offset_t
)
-
EPIPE
)
return
-
EPIPE
;
s
->
pos
=
offset
;
}
s
->
eof_reached
=
0
;
s
->
buf_ptr
=
s
->
buffer
;
if
(
s
->
seek
(
s
->
opaque
,
offset
,
SEEK_SET
)
==
(
offset_t
)
-
EPIPE
)
return
-
EPIPE
;
s
->
pos
=
offset
;
}
s
->
eof_reached
=
0
;
return
offset
;
}
...
...
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