From 981d56c3d1b8d8e7af47adf2394239df6bbf856a6ca56559fba864d6f9b7c466 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 21 Mar 2011 13:52:49 +0000 Subject: [PATCH] Accepting request 64649 from home:tiwai:branches:multimedia:libs ok OBS-URL: https://build.opensuse.org/request/show/64649 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=66 --- pulseaudio.changes | 6 ++++++ setup-pulseaudio | 17 +++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pulseaudio.changes b/pulseaudio.changes index 8e0df4f..1e21398 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 21 14:51:21 CET 2011 - tiwai@suse.de + +- Fix handling of /etc/mplayer/mplayer.conf in setup-pulseaudio + script (bnc#681113) + ------------------------------------------------------------------- Thu Feb 17 17:54:45 CET 2011 - tiwai@suse.de diff --git a/setup-pulseaudio b/setup-pulseaudio index d26aa95..f246c18 100644 --- a/setup-pulseaudio +++ b/setup-pulseaudio @@ -28,6 +28,8 @@ check_root() { PROFNAME=/etc/profile.d/pulseaudio.sh CPROFNAME=/etc/profile.d/pulseaudio.csh +MPLAYER_CONF=/etc/mplayer/mplayer.conf + set_variable () { if test -f $PROFNAME && grep -q "export $1"= $PROFNAME; then @@ -79,11 +81,13 @@ enable_libao() { enable_mplayer() { echo "Enabling PulseAudio for mplayer..." - if test -f /etc/mplayer/mplayer.conf; then - if grep -q '^ao=' /etc/mplayer/mplayer.conf; then - perl -pi -e "s|^ao=.*|ao=pulse|g;" /etc/mplayer/mplayer.conf + if test -f $MPLAYER_CONF; then + if grep -q '^ao *= *pulse' $MPLAYER_CONF; then + : + elif grep -q '^ao *=' $MPLAYER_CONF; then + sed -i -e 's/^ao *= *\(.*\)$/ao=pulse,\1/g' $MPLAYER_CONF else - echo "ao=pulse" >> /etc/mplayer/mplayer.conf + echo "ao=pulse" >> $MPLAYER_CONF fi fi @@ -178,9 +182,10 @@ disable_libao() { } disable_mplayer() { - if test -f /etc/mplayer/mplayer.conf; then + if test -f $MPLAYER_CONF; then echo "Disabling PulseAudio for mplayer..." - perl -pi -e "s|ao=pulse||g;" /etc/mplayer/mplayer.conf + sed -i -e 's/^ao *= *pulse,*/ao=/g' \ + -e 's/^ao *= *$/ao=alsa/g' $MPLAYER_CONF fi }