On 2014/03/06 19:12, Pete Beardmore <pete.beardm...@msn.com> wrote: > i've recently started using my secondary (internal) sound card for > headphones output, and regularly move the mpd pulseaudio stream back > and forth between the two outputs > > the issue i have/had is that when a playlist contains files with > multiple output formats, on change of format, the audio output is > re-initialised and the statically configured default sink is chosen. > this is not desirable if i've moved the stream to my secondary > output. i don't want to drive multiple outputs simultaneously > > the commit simply holds the (now dynamic) sink name in a string > (deliberately avoiding any requirements to manage memory), and > updates this from the pulse context callback. hopefully this is a > suitable method, please consider merging with mpd master
Your code will crash when no "sink" is configured, because the std::string is initialized with a nullptr. I'm not convinced that this is the best idea. Does every Pulse client have to replicate this behavior? Isn't there a better way? Can we change an existing stream to a different audio format instead, instead of destroying and creating a new one? Isn't there some kind of server-side stickiness? What happens if the sink that your code remembers suddenly vanishes while MPD is not playing, will reopening the output always fail until somebody creates a new sink with that name? _______________________________________________ mpd-devel mailing list mpd-devel@musicpd.org http://mailman.blarg.de/listinfo/mpd-devel