annotate android/project/build.xml @ 5080:6d94060d16a9

Fixed bug #1011 Daniel Ellis 2010-06-25 15:20:31 PDT SDL based applications sometimes display the wrong application name in the Sound Preferences dialog when using pulseaudio. I can see from the code that the SDL pulse module is initiating a new pulse audio context and passing an application name using the function get_progname(). The get_progname() function returns the name of the current process. However, the process name is often not a suitable name to use. For example, the OpenShot video editor is a python application, and so "python" is displayed in the Sound Preferences window (see Bug #596504), when it should be displaying "OpenShot". PulseAudio allows applications to specify the application name, either at the time the context is created (as SDL does currently), or by special environment variables (see http://www.pulseaudio.org/wiki/ApplicationProperties). If no name is specified, then pulseaudio will determine the name based on the process. If you specify the application name when initiating the pulseaudio context, then that will override any application name specified using an environment variable. As libsdl is a library, I believe the solution is for libsdl to not specify any application name when initiating a pulseaudio context, which will enable applications to specify the application name using environment variables. In the case that the applications do not specify anything, pulseaudio will fall back to using the process name anyway. The attached patch removes the get_progname() function and passes NULL as the application name when creating the pulseaudio context, which fixes the issue.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 23 Jan 2011 21:55:04 -0800
parents 9076cdb027af
children
rev   line source
4726
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
2 <project name="SDLApp" default="help">
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
3
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
4 <!-- The local.properties file is created and updated by the 'android' tool.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
5 It contains the path to the SDK. It should *NOT* be checked in in Version
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
6 Control Systems. -->
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
7 <property file="local.properties" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
8
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
9 <!-- The build.properties file can be created by you and is never touched
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
10 by the 'android' tool. This is the place to change some of the default property values
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
11 used by the Ant rules.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
12 Here are some properties you may want to change/update:
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
13
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
14 application.package
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
15 the name of your application package as defined in the manifest. Used by the
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
16 'uninstall' rule.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
17 source.dir
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
18 the name of the source directory. Default is 'src'.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
19 out.dir
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
20 the name of the output directory. Default is 'bin'.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
21
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
22 Properties related to the SDK location or the project target should be updated
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
23 using the 'android' tool with the 'update' action.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
24
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
25 This file is an integral part of the build system for your application and
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
26 should be checked in in Version Control Systems.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
27
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
28 -->
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
29 <property file="build.properties" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
30
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
31 <!-- The default.properties file is created and updated by the 'android' tool, as well
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
32 as ADT.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
33 This file is an integral part of the build system for your application and
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
34 should be checked in in Version Control Systems. -->
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
35 <property file="default.properties" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
36
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
37 <!-- Custom Android task to deal with the project target, and import the proper rules.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
38 This requires ant 1.6.0 or above. -->
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
39 <path id="android.antlibs">
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
40 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
41 <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
42 <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
43 <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
44 <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
45 </path>
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
46
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
47 <taskdef name="setup"
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
48 classname="com.android.ant.SetupTask"
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
49 classpathref="android.antlibs" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
50
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
51 <!-- Execute the Android Setup task that will setup some properties specific to the target,
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
52 and import the build rules files.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
53
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
54 The rules file is imported from
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
55 <SDK>/platforms/<target_platform>/templates/android_rules.xml
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
56
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
57 To customize some build steps for your project:
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
58 - copy the content of the main node <project> from android_rules.xml
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
59 - paste it in this build.xml below the <setup /> task.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
60 - disable the import by changing the setup task below to <setup import="false" />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
61
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
62 This will ensure that the properties are setup correctly but that your customized
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
63 build steps are used.
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
64 -->
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
65 <setup />
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
66
9076cdb027af Cleanups.
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
67 </project>