Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
efc27f36
Commit
efc27f36
authored
Mar 17, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udp: avoid alloc/free on I/O error
parent
0fde3bea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
modules/access/udp.c
modules/access/udp.c
+13
-16
No files found.
modules/access/udp.c
View file @
efc27f36
...
@@ -252,30 +252,27 @@ static void* ThreadRead( void *data )
...
@@ -252,30 +252,27 @@ static void* ThreadRead( void *data )
for
(
;;
)
for
(
;;
)
{
{
block_t
*
pkt
;
block_t
*
pkt
=
block_Alloc
(
MTU
);
ssize_t
len
;
if
(
unlikely
(
pkt
==
NULL
))
block_FifoPace
(
sys
->
fifo
,
SIZE_MAX
,
sys
->
fifo_size
);
pkt
=
block_Alloc
(
MTU
);
if
(
unlikely
(
pkt
==
NULL
)
)
break
;
break
;
block_cleanup_push
(
pkt
);
ssize_t
len
;
len
=
net_Read
(
access
,
sys
->
fd
,
NULL
,
pkt
->
p_buffer
,
MTU
,
false
);
block_cleanup_push
(
pkt
);
do
len
=
net_Read
(
access
,
sys
->
fd
,
NULL
,
pkt
->
p_buffer
,
MTU
,
false
);
while
(
len
==
-
1
&&
errno
!=
EINTR
);
vlc_cleanup_pop
();
vlc_cleanup_pop
();
if
(
len
==
-
1
)
if
(
len
==
-
1
)
{
{
block_Release
(
pkt
);
block_Release
(
pkt
);
if
(
errno
==
EINTR
)
break
;
break
;
continue
;
}
}
pkt
->
i_buffer
=
len
;
pkt
->
i_buffer
=
len
;
block_FifoPut
(
sys
->
fifo
,
pkt
);
block_FifoPace
(
sys
->
fifo
,
SIZE_MAX
,
sys
->
fifo_size
-
len
);
block_FifoPut
(
sys
->
fifo
,
pkt
);
}
}
block_FifoWake
(
sys
->
fifo
);
block_FifoWake
(
sys
->
fifo
);
...
...
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