Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
fe99a2ad
Commit
fe99a2ad
authored
Apr 28, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another select() -> poll()
parent
79852053
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
modules/access/dvb/access.c
modules/access/dvb/access.c
+14
-19
No files found.
modules/access/dvb/access.c
View file @
fe99a2ad
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/poll.h>
#include <errno.h>
#include <errno.h>
...
@@ -399,35 +400,29 @@ static block_t *Block( access_t *p_access )
...
@@ -399,35 +400,29 @@ static block_t *Block( access_t *p_access )
for
(
;
;
)
for
(
;
;
)
{
{
struct
timeval
timeout
;
struct
pollfd
ufds
[
2
];
fd_set
fds
,
fde
;
int
i_ret
;
int
i_ret
;
int
i_max_handle
=
p_sys
->
i_handle
;
/* Initialize file descriptor sets */
/* Initialize file descriptor sets */
FD_ZERO
(
&
fds
);
memset
(
ufds
,
0
,
sizeof
(
ufds
));
FD_ZERO
(
&
fde
);
ufds
[
0
].
fd
=
p_sys
->
i_handle
;
FD_SET
(
p_sys
->
i_handle
,
&
fds
);
ufds
[
0
].
events
=
POLLIN
;
FD_SET
(
p_sys
->
i_frontend_handle
,
&
fde
);
ufds
[
1
].
fd
=
p_sys
->
i_frontend_handle
;
if
(
p_sys
->
i_frontend_handle
>
i_max_handle
)
ufds
[
1
].
events
=
POLLOUT
;
i_max_handle
=
p_sys
->
i_frontend_handle
;
/* We'll wait 0.5 second if nothing happens */
/* We'll wait 0.5 second if nothing happens */
timeout
.
tv_sec
=
0
;
timeout
.
tv_usec
=
500000
;
/* Find if some data is available */
/* Find if some data is available */
i_ret
=
select
(
i_max_handle
+
1
,
&
fds
,
NULL
,
&
fde
,
&
timeout
);
i_ret
=
poll
(
ufds
,
2
,
500
);
if
(
p_access
->
b_die
)
if
(
p_access
->
b_die
)
return
NULL
;
return
NULL
;
if
(
i_ret
<
0
&&
errno
==
EINTR
)
continue
;
if
(
i_ret
<
0
)
if
(
i_ret
<
0
)
{
{
msg_Err
(
p_access
,
"select error (%s)"
,
strerror
(
errno
)
);
if
(
errno
==
EINTR
)
continue
;
msg_Err
(
p_access
,
"poll error: %s"
,
strerror
(
errno
)
);
return
NULL
;
return
NULL
;
}
}
...
@@ -437,7 +432,7 @@ static block_t *Block( access_t *p_access )
...
@@ -437,7 +432,7 @@ static block_t *Block( access_t *p_access )
p_sys
->
i_ca_next_event
=
mdate
()
+
p_sys
->
i_ca_timeout
;
p_sys
->
i_ca_next_event
=
mdate
()
+
p_sys
->
i_ca_timeout
;
}
}
if
(
FD_ISSET
(
p_sys
->
i_frontend_handle
,
&
fde
)
)
if
(
ufds
[
1
].
revents
)
{
{
E_
(
FrontendPoll
)(
p_access
);
E_
(
FrontendPoll
)(
p_access
);
}
}
...
@@ -479,7 +474,7 @@ static block_t *Block( access_t *p_access )
...
@@ -479,7 +474,7 @@ static block_t *Block( access_t *p_access )
E_
(
FrontendSet
)(
p_access
);
E_
(
FrontendSet
)(
p_access
);
}
}
if
(
FD_ISSET
(
p_sys
->
i_handle
,
&
fds
)
)
if
(
ufds
[
0
].
revents
)
{
{
p_block
=
block_New
(
p_access
,
p_block
=
block_New
(
p_access
,
p_sys
->
i_read_once
*
TS_PACKET_SIZE
);
p_sys
->
i_read_once
*
TS_PACKET_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