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
ba330e22
Commit
ba330e22
authored
Jun 30, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mms: stop polling every 500 milliseconds
parent
cdabd50c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
38 deletions
+27
-38
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+27
-38
No files found.
modules/access/mms/mmstu.c
View file @
ba330e22
...
...
@@ -43,6 +43,7 @@
#include <vlc_network.h>
#include <vlc_url.h>
#include <vlc_interrupt.h>
#include "asf.h"
#include "buffer.h"
...
...
@@ -1012,12 +1013,11 @@ static int NetFillBuffer( access_t *p_access )
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
int
i_ret
;
struct
pollfd
ufd
[
2
];
unsigned
timeout
,
nfd
;
unsigned
timeout
=
p_sys
->
i_timeout
,
nfd
=
0
;
/* FIXME when using udp */
ssize_t
i_tcp
,
i_udp
;
ssize_t
i_tcp_read
,
i_udp_read
;
int
i_try
=
0
;
i_tcp
=
MMS_BUFFER_SIZE
/
2
-
p_sys
->
i_buffer_tcp
;
...
...
@@ -1040,15 +1040,7 @@ static int NetFillBuffer( access_t *p_access )
/* msg_Warn( p_access, "ask for tcp:%d udp:%d", i_tcp, i_udp ); */
}
/* Find if some data is available */
do
{
i_try
++
;
/* Initialize file descriptor set */
memset
(
ufd
,
0
,
sizeof
(
ufd
));
nfd
=
0
;
if
(
i_tcp
>
0
)
{
ufd
[
nfd
].
fd
=
p_sys
->
i_handle_tcp
;
...
...
@@ -1062,28 +1054,25 @@ static int NetFillBuffer( access_t *p_access )
nfd
++
;
}
/* We'll wait 0.5 second if nothing happens */
timeout
=
__MIN
(
500
,
p_sys
->
i_timeout
);
/* Find if some data is available */
if
(
p_sys
->
i_buffer_tcp
>
0
||
p_sys
->
i_buffer_udp
>
0
)
timeout
=
2000
;
if
(
i_try
*
timeout
>
p_sys
->
i_timeout
)
do
{
msg_Err
(
p_access
,
"no data received"
);
if
(
!
vlc_object_alive
(
p_access
)
)
return
-
1
;
i_ret
=
vlc_poll_i11e
(
ufd
,
nfd
,
timeout
);
}
while
(
i_ret
<
0
&&
errno
==
EINTR
);
/* FIXME: recompute timeout */
if
(
i_try
>
3
&&
(
p_sys
->
i_buffer_tcp
>
0
||
p_sys
->
i_buffer_udp
>
0
)
)
if
(
i_ret
==
0
)
{
msg_Err
(
p_access
,
"no data received"
);
return
-
1
;
}
if
(
!
vlc_object_alive
(
p_access
)
)
return
-
1
;
//msg_Dbg( p_access, "NetFillBuffer: trying again (select)" );
}
while
(
!
(
i_ret
=
poll
(
ufd
,
nfd
,
timeout
))
||
(
i_ret
<
0
&&
errno
==
EINTR
)
);
if
(
i_ret
<
0
)
{
msg_Err
(
p_access
,
"network poll error: %s"
,
vlc_strerror_c
(
errno
)
);
...
...
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