http://bugs.gentoo.org/329737
http://trac.xiph.org/ticket/1689

--- src/plugins/pulse/ao_pulse.c
+++ src/plugins/pulse/ao_pulse.c
@@ -227,7 +227,7 @@
     }
 
 
-    if (!(internal->simple = pa_simple_new(internal->server, fn ? t : "libao", PA_STREAM_PLAYBACK, internal->sink, fn ? t2 : "libao playback stream", &ss, &map, NULL, NULL)))
+    if (!(internal->simple = pa_simple_new(internal->server, fn ? t : "libao", PA_STREAM_PLAYBACK, internal->sink, fn ? t2 : "libao playback stream", &ss, device->input_map ? &map : NULL, NULL, NULL)))
         return 0;
 
     device->driver_byte_format = AO_FMT_NATIVE;
@@ -247,9 +247,11 @@
     assert(device && device->internal);
     ao_pulse_internal *internal = (ao_pulse_internal *) device->internal;
 
-    pa_simple_drain(internal->simple, NULL);
-    pa_simple_free(internal->simple);
-    internal->simple = NULL;
+    if (internal->simple) {
+        pa_simple_drain(internal->simple, NULL);
+        pa_simple_free(internal->simple);
+        internal->simple = NULL;
+    }
 
     return 1;
 }
