summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2017-09-11 16:15:45 +0100
committerFrediano Ziglio <fziglio@redhat.com>2017-09-19 16:17:11 +0100
commit0da0673bd35e1f0ffcda8374be47b305675ed95c (patch)
tree35746506553f0011cc3963eb2b1a7e65aa63bff4
parent8626f5bf3e017acf071b51ddef8654df4d4d70a2 (diff)
sound: Use GLib memory functions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
-rw-r--r--server/sound.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/sound.c b/server/sound.c
index de51a467..9073626c 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -795,7 +795,7 @@ snd_channel_client_alloc_recv_buf(RedChannelClient *rcc, uint16_t type, uint32_t
SndChannelClient *client = SND_CHANNEL_CLIENT(rcc);
// If message is too big allocate one, this should never happen
if (size > sizeof(client->receive_buf)) {
- return spice_malloc(size);
+ return g_malloc(size);
}
return client->receive_buf;
}
@@ -806,7 +806,7 @@ snd_channel_client_release_recv_buf(RedChannelClient *rcc, uint16_t type, uint32
{
SndChannelClient *client = SND_CHANNEL_CLIENT(rcc);
if (msg != client->receive_buf) {
- free(msg);
+ g_free(msg);
}
}
@@ -825,8 +825,8 @@ static void snd_channel_set_volume(SndChannel *channel,
SndChannelClient *client = snd_channel_get_client(channel);
st->volume_nchannels = nchannels;
- free(st->volume);
- st->volume = spice_memdup(volume, sizeof(uint16_t) * nchannels);
+ g_free(st->volume);
+ st->volume = g_memdup(volume, sizeof(uint16_t) * nchannels);
if (!client || nchannels == 0)
return;
@@ -951,7 +951,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_put_samples(SpicePlaybackInstance
if (frame->allocated) {
frame->allocated = false;
if (--frame->container->refs == 0) {
- free(frame->container);
+ g_free(frame->container);
return;
}
}
@@ -1025,7 +1025,7 @@ playback_channel_client_finalize(GObject *object)
playback_client->frames->items[i].client = NULL;
}
if (--playback_client->frames->refs == 0) {
- free(playback_client->frames);
+ g_free(playback_client->frames);
}
if (client->active) {
@@ -1302,7 +1302,7 @@ snd_channel_finalize(GObject *object)
remove_channel(channel);
- free(channel->volume.volume);
+ g_free(channel->volume.volume);
channel->volume.volume = NULL;
G_OBJECT_CLASS(snd_channel_parent_class)->finalize(object);
@@ -1490,7 +1490,7 @@ static void snd_playback_alloc_frames(PlaybackChannelClient *playback)
{
int i;
- playback->frames = spice_new0(AudioFrameContainer, 1);
+ playback->frames = g_new0(AudioFrameContainer, 1);
playback->frames->refs = 1;
for (i = 0; i < NUM_AUDIO_FRAMES; ++i) {
playback->frames->items[i].container = playback->frames;