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
e39eeb10
Commit
e39eeb10
authored
Dec 19, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: split out ffio_limit()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f85334f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
avio_internal.h
libavformat/avio_internal.h
+2
-0
utils.c
libavformat/utils.c
+8
-4
No files found.
libavformat/avio_internal.h
View file @
e39eeb10
...
...
@@ -71,6 +71,8 @@ uint64_t ffio_read_varlen(AVIOContext *bc);
/** @warning must be called before any I/O */
int
ffio_set_buf_size
(
AVIOContext
*
s
,
int
buf_size
);
int
ffio_limit
(
AVIOContext
*
s
,
int
size
);
void
ffio_init_checksum
(
AVIOContext
*
s
,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
);
...
...
libavformat/utils.c
View file @
e39eeb10
...
...
@@ -264,11 +264,8 @@ AVInputFormat *av_find_input_format(const char *short_name)
return
NULL
;
}
int
av_get_packet
(
AVIOContext
*
s
,
AVPacket
*
pkt
,
int
size
)
int
ffio_limit
(
AVIOContext
*
s
,
int
size
)
{
int
ret
;
if
(
s
->
maxsize
>=
0
){
int64_t
remaining
=
s
->
maxsize
-
avio_tell
(
s
);
if
(
remaining
<
size
){
...
...
@@ -283,6 +280,13 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
size
=
remaining
+
1
;
}
}
return
size
;
}
int
av_get_packet
(
AVIOContext
*
s
,
AVPacket
*
pkt
,
int
size
)
{
int
ret
;
size
=
ffio_limit
(
s
,
size
);
ret
=
av_new_packet
(
pkt
,
size
);
...
...
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