]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'master' into next
authorAndre Noll <maan@systemlinux.org>
Sat, 2 May 2009 09:50:17 +0000 (11:50 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 2 May 2009 09:50:17 +0000 (11:50 +0200)
1  2 
alsa_write.c

diff --combined alsa_write.c
index dd91cd84f1d5e648a2b1a4f0fa3a7859a7f51093,e070399d3f0dbf0145fa39e090b46d5f7c6cbb63..b6a087a3d6b87353796dff34ac790d6c64f58e4d
@@@ -45,8 -45,8 +45,8 @@@ struct private_alsa_write_data 
         */
        unsigned samplerate;
        /**
-        * 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.
         */
        unsigned channels;
  };
@@@ -164,7 -164,7 +164,7 @@@ static int alsa_write_post_select(__a_u
        struct private_alsa_write_data *pad = wn->private_data;
        struct writer_node_group *wng = wn->wng;
        size_t frames, bytes = *wng->loaded - wn->written;
 -      unsigned char *data = (unsigned char*)wng->buf + wn->written;
 +      unsigned char *data = (unsigned char*)*wng->bufp + wn->written;
        struct timeval tv;
        snd_pcm_sframes_t ret;
  
@@@ -211,9 -211,12 +211,12 @@@ static void alsa_close(struct writer_no
  {
        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();
+       }
        free(pad);
  }