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
2adf422c
Commit
2adf422c
authored
Mar 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/aviobuf: factorize buffer_size out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7e268a8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
aviobuf.c
libavformat/aviobuf.c
+4
-2
No files found.
libavformat/aviobuf.c
View file @
2adf422c
...
...
@@ -201,12 +201,14 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
int64_t
offset1
;
int64_t
pos
;
int
force
=
whence
&
AVSEEK_FORCE
;
int
buffer_size
;
whence
&=
~
AVSEEK_FORCE
;
if
(
!
s
)
return
AVERROR
(
EINVAL
);
pos
=
s
->
pos
-
(
s
->
write_flag
?
0
:
(
s
->
buf_end
-
s
->
buffer
));
buffer_size
=
s
->
buf_end
-
s
->
buffer
;
pos
=
s
->
pos
-
(
s
->
write_flag
?
0
:
buffer_size
);
if
(
whence
!=
SEEK_CUR
&&
whence
!=
SEEK_SET
)
return
AVERROR
(
EINVAL
);
...
...
@@ -219,7 +221,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
}
offset1
=
offset
-
pos
;
if
(
!
s
->
must_flush
&&
(
!
s
->
direct
||
!
s
->
seek
)
&&
offset1
>=
0
&&
offset1
<=
(
s
->
buf_end
-
s
->
buffer
)
)
{
offset1
>=
0
&&
offset1
<=
buffer_size
)
{
/* can do the seek inside the buffer */
s
->
buf_ptr
=
s
->
buffer
+
offset1
;
}
else
if
((
!
s
->
seekable
||
...
...
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