File libflashsupport-detect-pulseaudio.patch of Package libflashsupport

Index: flashsupport.c
===================================================================
--- flashsupport.c.orig
+++ flashsupport.c
@@ -325,9 +325,6 @@ void FPX_SoundOutput_Detect()
 	void *handle;
 	char *error;	
 #endif 
-#if defined(PULSEAUDIO)
-	char tmpstr[1024]="";
-#endif
 	if((tmpenv=getenv("FLASH_AUDIODEBUG"))!=NULL) {
 		audiodebug=1;
 	}
@@ -343,18 +340,8 @@ void FPX_SoundOutput_Detect()
 
 #if defined(PULSEAUDIO)
 	//Check if PULSE AUDIO is running
-	if((tmpenv=getenv("USER"))!=NULL) {
-		strcpy(tmpstr,"/tmp/pulse-");
-		strcat(tmpstr,tmpenv);
-		if(!stat(tmpstr,&buf)) {
-			if(audiodebug) fprintf( stderr, "PulseAudio socket found\n");
-			audiodrivers = audiodrivers | AUDIO_PULSE;
-		}
-	}
-	//Check if PULSE AUDIO is running system-wide
-	strcpy(tmpstr,"/var/lib/run/pulse/native");
-	if(!stat(tmpstr,&buf)) {
-		if(audiodebug) fprintf( stderr, "PulseAudio system-wide found\n");
+	if(system("pactl stat") == 0) {
+		if(audiodebug) fprintf( stderr, "PulseAudio server found\n");
 		audiodrivers = audiodrivers | AUDIO_PULSE;
 	}
 	//Pulse over network
openSUSE Build Service is sponsored by