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
76a1cae5
Commit
76a1cae5
authored
Feb 08, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{input,mixer}/alsa: fix off-by-one bug in count check
Doesn't make a practical difference - but it's more correct this way.
parent
81a97315
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+1
-1
AlsaMixerPlugin.cxx
src/mixer/plugins/AlsaMixerPlugin.cxx
+1
-1
No files found.
src/input/plugins/AlsaInputPlugin.cxx
View file @
76a1cae5
...
@@ -181,7 +181,7 @@ AlsaInputStream::PrepareSockets()
...
@@ -181,7 +181,7 @@ AlsaInputStream::PrepareSockets()
}
}
int
count
=
snd_pcm_poll_descriptors_count
(
capture_handle
);
int
count
=
snd_pcm_poll_descriptors_count
(
capture_handle
);
if
(
count
<
0
)
{
if
(
count
<
=
0
)
{
ClearSocketList
();
ClearSocketList
();
return
std
::
chrono
::
steady_clock
::
duration
(
-
1
);
return
std
::
chrono
::
steady_clock
::
duration
(
-
1
);
}
}
...
...
src/mixer/plugins/AlsaMixerPlugin.cxx
View file @
76a1cae5
...
@@ -102,7 +102,7 @@ AlsaMixerMonitor::PrepareSockets()
...
@@ -102,7 +102,7 @@ AlsaMixerMonitor::PrepareSockets()
}
}
int
count
=
snd_mixer_poll_descriptors_count
(
mixer
);
int
count
=
snd_mixer_poll_descriptors_count
(
mixer
);
if
(
count
<
0
)
if
(
count
<
=
0
)
count
=
0
;
count
=
0
;
struct
pollfd
*
pfds
=
pfd_buffer
.
Get
(
count
);
struct
pollfd
*
pfds
=
pfd_buffer
.
Get
(
count
);
...
...
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