mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libspark/audio_mixer: don't try to free() stack-allocated snd_mixer_selem_id
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
#include <audio_mixer.h>
|
#include <audio_mixer.h>
|
||||||
|
|
||||||
mixerVolume::mixerVolume(const char *name, const char *card, long volume) {
|
mixerVolume::mixerVolume(const char *name, const char *card, long volume) {
|
||||||
sid = NULL;
|
snd_mixer_selem_id_t *sid = NULL;
|
||||||
elem = NULL;
|
elem = NULL;
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
min = 0;
|
min = 0;
|
||||||
@@ -58,8 +58,6 @@ mixerVolume::~mixerVolume()
|
|||||||
{
|
{
|
||||||
if (handle)
|
if (handle)
|
||||||
snd_mixer_close(handle);
|
snd_mixer_close(handle);
|
||||||
if (sid)
|
|
||||||
snd_mixer_selem_id_free(sid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mixerVolume::setVolume(long volume) {
|
bool mixerVolume::setVolume(long volume) {
|
||||||
|
@@ -27,7 +27,6 @@ class mixerVolume
|
|||||||
long min, max;
|
long min, max;
|
||||||
snd_mixer_t *handle;
|
snd_mixer_t *handle;
|
||||||
snd_mixer_elem_t* elem;
|
snd_mixer_elem_t* elem;
|
||||||
snd_mixer_selem_id_t *sid;
|
|
||||||
public:
|
public:
|
||||||
mixerVolume(const char *selem_name, const char *Card, long volume = -1);
|
mixerVolume(const char *selem_name, const char *Card, long volume = -1);
|
||||||
~mixerVolume(void);
|
~mixerVolume(void);
|
||||||
|
Reference in New Issue
Block a user