+ const struct pa_buffer_attr *pba = pa_stream_get_buffer_attr(s);
+ msg_Dbg(aout, "using buffer metrics: maxlength=%u, tlength=%u, "
+ "prebuf=%u, minreq=%u",
+ pba->maxlength, pba->tlength, pba->prebuf, pba->minreq);
+
+ aout->output.i_nb_samples = pba->minreq / pa_frame_size(&ss);
+
+ var_Create(aout, "audio-device", VLC_VAR_INTEGER|VLC_VAR_HASCHOICE);
+ var_Change(aout, "audio-device", VLC_VAR_SETTEXT,
+ &(vlc_value_t){ .psz_string = (char *)_("Audio device") },
+ NULL);
+ var_AddCallback (aout, "audio-device", StreamMove, s);
+ op = pa_context_get_sink_info_list(ctx, sink_list_cb, aout);
+ /* We may need to wait for completion... once LibVLC supports this */
+ if (op != NULL)
+ pa_operation_unref(op);
+ stream_moved_cb(s, aout);
+ pa_threaded_mainloop_unlock(mainloop);
+
+ aout->output.pf_play = Play;
+ aout->output.pf_pause = NULL;
+ aout->output.pf_volume_set = VolumeSet;
+ return VLC_SUCCESS;