Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
be0c8495
Commit
be0c8495
authored
Aug 10, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/MultiSocketMonitor: PrepareSockets() returns timeout
Simplify the API, don't use GLib specific integer type.
parent
cbd0709d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
MultiSocketMonitor.hxx
src/event/MultiSocketMonitor.hxx
+5
-2
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+7
-6
AlsaMixerPlugin.cxx
src/mixer/AlsaMixerPlugin.cxx
+5
-3
No files found.
src/event/MultiSocketMonitor.hxx
View file @
be0c8495
...
...
@@ -101,7 +101,10 @@ public:
}
protected
:
virtual
void
PrepareSockets
(
gcc_unused
gint
*
timeout_r
)
{}
/**
* @return timeout [ms] or -1 for no timeout
*/
virtual
int
PrepareSockets
()
=
0
;
virtual
bool
CheckSockets
()
const
{
return
false
;
}
virtual
void
DispatchSockets
()
=
0
;
...
...
@@ -114,7 +117,7 @@ public:
private
:
bool
Prepare
(
gint
*
timeout_r
)
{
PrepareSockets
(
timeout_r
);
*
timeout_r
=
PrepareSockets
(
);
return
false
;
}
...
...
src/input/CurlInputPlugin.cxx
View file @
be0c8495
...
...
@@ -204,7 +204,7 @@ public:
private
:
void
UpdateSockets
();
virtual
void
PrepareSockets
(
gcc_unused
gint
*
timeout_r
)
override
;
virtual
int
PrepareSockets
(
)
override
;
virtual
bool
CheckSockets
()
const
override
;
virtual
void
DispatchSockets
()
override
;
};
...
...
@@ -536,8 +536,8 @@ input_curl_perform(void)
return
true
;
}
void
CurlSockets
::
PrepareSockets
(
gint
*
timeout_r
)
int
CurlSockets
::
PrepareSockets
()
{
UpdateSockets
();
...
...
@@ -556,12 +556,13 @@ CurlSockets::PrepareSockets(gint *timeout_r)
Let's use a lower limit of 10ms. */
timeout2
=
10
;
*
timeout_r
=
timeout2
;
have_timeout
=
timeout2
>=
0
;
}
else
return
timeout2
;
}
else
{
g_warning
(
"curl_multi_timeout() failed: %s
\n
"
,
curl_multi_strerror
(
mcode
));
return
-
1
;
}
}
bool
...
...
src/mixer/AlsaMixerPlugin.cxx
View file @
be0c8495
...
...
@@ -44,7 +44,7 @@ public:
:
MultiSocketMonitor
(
_loop
),
mixer
(
_mixer
)
{}
private
:
virtual
void
PrepareSockets
(
gcc_unused
gint
*
timeout_r
)
override
;
virtual
int
PrepareSockets
(
)
override
;
virtual
void
DispatchSockets
()
override
;
};
...
...
@@ -83,8 +83,8 @@ alsa_mixer_quark(void)
return
g_quark_from_static_string
(
"alsa_mixer"
);
}
void
AlsaMixerMonitor
::
PrepareSockets
(
gcc_unused
gint
*
timeout_r
)
int
AlsaMixerMonitor
::
PrepareSockets
()
{
int
count
=
snd_mixer_poll_descriptors_count
(
mixer
);
if
(
count
<
0
)
...
...
@@ -113,6 +113,8 @@ AlsaMixerMonitor::PrepareSockets(gcc_unused gint *timeout_r)
for
(
auto
i
=
pfds
;
i
!=
end
;
++
i
)
if
(
i
->
events
!=
0
)
AddSocket
(
i
->
fd
,
i
->
events
);
return
-
1
;
}
void
...
...
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