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
d357f585
Commit
d357f585
authored
Jan 10, 2009
by
Viliam Mateicka
Committed by
Max Kellermann
Jan 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removing mixer_reconfigure memmory leak, fixing configure of alsa and oss mixer…
removing mixer_reconfigure memmory leak, fixing configure of alsa and oss mixer (passing parameters)
parent
983822ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
9 deletions
+32
-9
conf.c
src/conf.c
+1
-1
conf.h
src/conf.h
+3
-0
alsa_mixer.c
src/mixer/alsa_mixer.c
+14
-4
oss_mixer.c
src/mixer/oss_mixer.c
+12
-4
volume.c
src/volume.c
+2
-0
No files found.
src/conf.c
View file @
d357f585
...
...
@@ -80,7 +80,7 @@ ConfigParam *newConfigParam(const char *value, int line)
return
ret
;
}
static
void
void
config_param_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
ConfigParam
*
param
=
data
;
...
...
src/conf.h
View file @
d357f585
...
...
@@ -20,6 +20,7 @@
#define MPD_CONF_H
#include <stdbool.h>
#include <glib.h>
#define CONF_MUSIC_DIR "music_directory"
#define CONF_PLAYLIST_DIR "playlist_directory"
...
...
@@ -105,6 +106,8 @@ int getBoolBlockParam(ConfigParam *param, const char *name, int force);
ConfigParam
*
newConfigParam
(
const
char
*
value
,
int
line
);
void
config_param_free
(
gpointer
data
,
gpointer
user_data
);
void
addBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
);
#endif
src/mixer/alsa_mixer.c
View file @
d357f585
...
...
@@ -36,6 +36,10 @@ static void
alsa_mixer_finish
(
struct
mixer_data
*
data
)
{
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
if
(
am
->
device
)
g_free
(
am
->
device
);
if
(
am
->
control
)
g_free
(
am
->
control
);
g_free
(
am
);
}
...
...
@@ -45,10 +49,16 @@ alsa_mixer_configure(struct mixer_data *data, ConfigParam *param)
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
BlockParam
*
bp
;
if
((
bp
=
getBlockParam
(
param
,
"mixer_device"
)))
am
->
device
=
bp
->
value
;
if
((
bp
=
getBlockParam
(
param
,
"mixer_control"
)))
am
->
control
=
bp
->
value
;
if
((
bp
=
getBlockParam
(
param
,
"mixer_device"
)))
{
if
(
am
->
device
)
g_free
(
am
->
device
);
am
->
device
=
g_strdup
(
bp
->
value
);
}
if
((
bp
=
getBlockParam
(
param
,
"mixer_control"
)))
{
if
(
am
->
control
)
g_free
(
am
->
control
);
am
->
control
=
g_strdup
(
bp
->
value
);
}
}
static
void
...
...
src/mixer/oss_mixer.c
View file @
d357f585
...
...
@@ -19,8 +19,8 @@
#define VOLUME_MIXER_OSS_DEFAULT "/dev/mixer"
struct
oss_mixer
{
c
onst
c
har
*
device
;
c
onst
c
har
*
control
;
char
*
device
;
char
*
control
;
int
device_fd
;
int
volume_control
;
};
...
...
@@ -40,6 +40,10 @@ static void
oss_mixer_finish
(
struct
mixer_data
*
data
)
{
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
if
(
om
->
device
)
g_free
(
om
->
device
);
if
(
om
->
control
)
g_free
(
om
->
control
);
g_free
(
om
);
}
...
...
@@ -50,11 +54,15 @@ oss_mixer_configure(struct mixer_data *data, ConfigParam *param)
BlockParam
*
bp
;
bp
=
getBlockParam
(
param
,
"mixer_device"
);
if
(
bp
)
{
om
->
device
=
bp
->
value
;
if
(
om
->
device
)
g_free
(
om
->
device
);
om
->
device
=
g_strdup
(
bp
->
value
);
}
bp
=
getBlockParam
(
param
,
"mixer_control"
);
if
(
bp
)
{
om
->
control
=
bp
->
value
;
if
(
om
->
control
)
g_free
(
om
->
control
);
om
->
control
=
g_strdup
(
bp
->
value
);
}
}
...
...
src/volume.c
View file @
d357f585
...
...
@@ -71,6 +71,8 @@ mixer_reconfigure(char *driver)
g_error
(
"Using mixer_type '%s' with not enabled %s output"
,
driver
,
driver
);
}
}
//free parameter list
config_param_free
(
newparam
,
NULL
);
}
void
volume_init
(
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