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
ede828c9
Commit
ede828c9
authored
Oct 23, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mixer_control: allow methods "open" and "close" to be NULL
It's possible to have a mixer implementation which does not explicitly need the methods open() and close().
parent
7dd172ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
20 deletions
+5
-20
software_mixer_plugin.c
src/mixer/software_mixer_plugin.c
+0
-19
mixer_control.c
src/mixer_control.c
+5
-1
No files found.
src/mixer/software_mixer_plugin.c
View file @
ede828c9
...
...
@@ -61,23 +61,6 @@ software_mixer_finish(struct mixer *data)
g_free
(
sm
);
}
static
bool
software_mixer_open
(
struct
mixer
*
data
,
G_GNUC_UNUSED
GError
**
error_r
)
{
struct
software_mixer
*
sm
=
(
struct
software_mixer
*
)
data
;
(
void
)
sm
;
return
true
;
}
static
void
software_mixer_close
(
struct
mixer
*
data
)
{
struct
software_mixer
*
sm
=
(
struct
software_mixer
*
)
data
;
(
void
)
sm
;
}
static
int
software_mixer_get_volume
(
struct
mixer
*
mixer
,
G_GNUC_UNUSED
GError
**
error_r
)
{
...
...
@@ -109,8 +92,6 @@ software_mixer_set_volume(struct mixer *mixer, unsigned volume,
const
struct
mixer_plugin
software_mixer_plugin
=
{
.
init
=
software_mixer_init
,
.
finish
=
software_mixer_finish
,
.
open
=
software_mixer_open
,
.
close
=
software_mixer_close
,
.
get_volume
=
software_mixer_get_volume
,
.
set_volume
=
software_mixer_set_volume
,
.
global
=
true
,
...
...
src/mixer_control.c
View file @
ede828c9
...
...
@@ -66,6 +66,8 @@ mixer_open(struct mixer *mixer, GError **error_r)
if
(
mixer
->
open
)
success
=
true
;
else
if
(
mixer
->
plugin
->
open
==
NULL
)
success
=
mixer
->
open
=
true
;
else
success
=
mixer
->
open
=
mixer
->
plugin
->
open
(
mixer
,
error_r
);
...
...
@@ -83,7 +85,9 @@ mixer_close_internal(struct mixer *mixer)
assert
(
mixer
->
plugin
!=
NULL
);
assert
(
mixer
->
open
);
mixer
->
plugin
->
close
(
mixer
);
if
(
mixer
->
plugin
->
close
!=
NULL
)
mixer
->
plugin
->
close
(
mixer
);
mixer
->
open
=
false
;
}
...
...
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