- * the number of channels, also given by command line option or the
- * decoder of the writer node group
+ * The number of channels, given by command line option or the
+ * decoder of the writer node group.
struct private_alsa_write_data *pad = wn->private_data;
struct writer_node_group *wng = wn->wng;
size_t frames, bytes = *wng->loaded - wn->written;
struct private_alsa_write_data *pad = wn->private_data;
struct writer_node_group *wng = wn->wng;
size_t frames, bytes = *wng->loaded - wn->written;
{
struct private_alsa_write_data *pad = wn->private_data;
PARA_INFO_LOG("closing writer node %p\n", wn);
{
struct private_alsa_write_data *pad = wn->private_data;
PARA_INFO_LOG("closing writer node %p\n", wn);
- snd_pcm_drain(pad->handle);
- snd_pcm_close(pad->handle);
- snd_config_update_free_global();
+
+ if (pad->handle) {
+ snd_pcm_drain(pad->handle);
+ snd_pcm_close(pad->handle);
+ snd_config_update_free_global();
+ }