Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
2e93e3aa
Commit
2e93e3aa
authored
23 years ago
by
Fabrice Bellard
Browse files
Options
Downloads
Patches
Plain Diff
fixed raw read for eof
Originally committed as revision 121 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
9dbf9389
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libav/raw.c
+10
-12
10 additions, 12 deletions
libav/raw.c
with
10 additions
and
12 deletions
libav/raw.c
+
10
−
12
View file @
2e93e3aa
...
@@ -84,27 +84,25 @@ static int raw_read_header(AVFormatContext *s,
...
@@ -84,27 +84,25 @@ static int raw_read_header(AVFormatContext *s,
return
0
;
return
0
;
}
}
#define
MIN
_SIZE 1024
#define
RAW_PACKET
_SIZE 1024
int
raw_read_packet
(
AVFormatContext
*
s
,
int
raw_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
AVPacket
*
pkt
)
{
{
int
packet_size
,
n
,
ret
;
int
ret
;
if
(
url_feof
(
&
s
->
pb
))
if
(
av_new_packet
(
pkt
,
RAW_PACKET_SIZE
)
<
0
)
return
-
EIO
;
packet_size
=
url_get_packet_size
(
&
s
->
pb
);
n
=
MIN_SIZE
/
packet_size
;
if
(
n
<=
0
)
n
=
1
;
if
(
av_new_packet
(
pkt
,
n
*
packet_size
)
<
0
)
return
-
EIO
;
return
-
EIO
;
pkt
->
stream_index
=
0
;
pkt
->
stream_index
=
0
;
ret
=
get_buffer
(
&
s
->
pb
,
pkt
->
data
,
pkt
->
size
);
ret
=
get_buffer
(
&
s
->
pb
,
pkt
->
data
,
RAW_PACKET_SIZE
);
if
(
ret
<
0
)
if
(
ret
<
=
0
)
{
av_free_packet
(
pkt
);
av_free_packet
(
pkt
);
return
-
EIO
;
}
/* note: we need to modify the packet size here to handle the last
packet */
pkt
->
size
=
ret
;
return
ret
;
return
ret
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment