diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-04-29 16:08:37 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-05-07 21:50:43 +0200 |
commit | 1d0a91d5ea7eb239d24fa58da4756fdac1b0155b (patch) | |
tree | ddfa4f0f666b0c0024a8b632c8aa8cb58ae62510 | |
parent | 81d8175d9d6a8297b10cead6c951bf560f61be4c (diff) |
audio: emit stop when the channels are reset
Ensure a hint is given to the client that the channel is reset.
Unfortunately, since the handle may be asynchronous due to coroutine,
the channel functions should be tolerant to a playback/record calls
functions when the channel is stopped.
-rw-r--r-- | gtk/channel-playback.c | 2 | ||||
-rw-r--r-- | gtk/channel-record.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c index ae8a75d..9d45e1f 100644 --- a/gtk/channel-playback.c +++ b/gtk/channel-playback.c @@ -172,6 +172,8 @@ static void spice_playback_channel_reset(SpiceChannel *channel, gboolean migrati SpicePlaybackChannelPrivate *c = SPICE_PLAYBACK_CHANNEL(channel)->priv; snd_codec_destroy(&c->codec); + g_coroutine_signal_emit(channel, signals[SPICE_PLAYBACK_STOP], 0); + c->is_active = FALSE; SPICE_CHANNEL_CLASS(spice_playback_channel_parent_class)->channel_reset(channel, migrating); } diff --git a/gtk/channel-record.c b/gtk/channel-record.c index ac71999..0b41349 100644 --- a/gtk/channel-record.c +++ b/gtk/channel-record.c @@ -169,6 +169,9 @@ static void channel_reset(SpiceChannel *channel, gboolean migrating) g_free(c->last_frame); c->last_frame = NULL; + g_coroutine_signal_emit(channel, signals[SPICE_RECORD_STOP], 0); + c->started = FALSE; + snd_codec_destroy(&c->codec); SPICE_CHANNEL_CLASS(spice_record_channel_parent_class)->channel_reset(channel, migrating); |