• David Guibert's avatar
    pulse_mixer: allow mpd to reconnect to the pulse mixer · 498ec26f
    David Guibert authored
    This patch follows the commit 21bb10f4.
    
    >From Max Kellermann:
    > I removed the daemonization changes in main.c.  Please explain why you
    > changed that.  If you need it for some reason, make that a separate
    > patch with a good description of your rationale.
    
    > That's the biggest flaw of your code: it opens the mixer device in the
    > init() method, while the open() method is empty.  When the pulse
    > daemon is not available (either during MPD startup or when it dies
    > while MPD runs), the plugin will not even attempt to reconnect to
    > pulse.  Please move the code to the open() method, to make that work.
    
    I changed the daemonize call as the fork losts the connection to the
    pulse server. According to your remark, the init() method should be
    moved to the open() ones.
    
    With the modification, mpd is able to reconnect the pulse mixer after
    restarting the pulseaudio daemon.
    Signed-off-by: 's avatarDavid Guibert <david.guibert@gmail.com>
    Signed-off-by: 's avatarMax Kellermann <max@duempel.org>
    498ec26f
pulse_mixer.c 6.76 KB