~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/utils/pax11publish.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2008-11-04 15:46:00 UTC
  • mfrom: (1.2.1 upstream) (1.1.6 lenny)
  • Revision ID: james.westby@ubuntu.com-20081104154600-hlzknpcazaam0nxm
Tags: 0.9.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Don't build against, and create jack package. Jack is not in main.
  - Remove --disable-per-user-esound-socket from configure flags, as we still
    want per user esound sockets.
  - Remove stop links from rc0 and rc6.
  - Change default resample algorithm and bubffer size.
  - Add alsa configuration files to route alsa applications via pulseaudio.
  - Move libasound2-plugins from Recommends to Depends.
* debian/pulseaudio.preinst: When upgrading from intrepid, remove
  /etc/X11/Xsession.d/70pulseaudio, as this was used to minimize a race
  condition when starting GNOME in intrepid. This race should not exist in
  jaunty once libcanberra is built to use pulseaudio as a backend.
* Do not spawn a pulseaudio server if clients fail to find a running server.
* Remove explicit version dependency for libspeex-dev to allow the package
  to be built for now.
* Regenerate autotools files to work with Ubuntu's newer libtool/libltdl.
* debian/control: libpulsecore5 -> libpulsecore8 to match the library
  soname.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: pax11publish.c 1426 2007-02-13 15:35:19Z ossman $ */
2
 
 
3
1
/***
4
2
  This file is part of PulseAudio.
5
3
 
29
27
#include <getopt.h>
30
28
#include <string.h>
31
29
#include <assert.h>
 
30
#include <locale.h>
32
31
 
33
32
#include <X11/Xlib.h>
34
33
#include <X11/Xatom.h>
35
34
 
36
35
#include <pulse/util.h>
 
36
#include <pulse/i18n.h>
37
37
 
38
38
#include <pulsecore/core-util.h>
39
39
#include <pulsecore/log.h>
49
49
    Display *d = NULL;
50
50
    enum { DUMP, EXPORT, IMPORT, REMOVE } mode = DUMP;
51
51
 
 
52
    setlocale(LC_ALL, "");
 
53
    bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
 
54
 
52
55
    while ((c = getopt(argc, argv, "deiD:S:O:I:c:hr")) != -1) {
53
56
        switch (c) {
54
57
            case 'D' :
55
58
                dname = optarg;
56
59
                break;
57
60
            case 'h':
58
 
                printf("%s [-D display] [-S server] [-O sink] [-I source] [-c file]  [-d|-e|-i|-r]\n\n"
 
61
                printf(_("%s [-D display] [-S server] [-O sink] [-I source] [-c file]  [-d|-e|-i|-r]\n\n"
59
62
                       " -d    Show current PulseAudio data attached to X11 display (default)\n"
60
63
                       " -e    Export local PulseAudio data to X11 display\n"
61
64
                       " -i    Import PulseAudio data from X11 display to local environment variables and cookie file.\n"
62
 
                       " -r    Remove PulseAudio data from X11 display\n",
 
65
                       " -r    Remove PulseAudio data from X11 display\n"),
63
66
                       pa_path_get_filename(argv[0]));
64
67
                ret = 0;
65
68
                goto finish;
88
91
                server = optarg;
89
92
                break;
90
93
            default:
91
 
                fprintf(stderr, "Failed to parse command line.\n");
 
94
                fprintf(stderr, _("Failed to parse command line.\n"));
92
95
                goto finish;
93
96
        }
94
97
    }
95
98
 
96
99
    if (!(d = XOpenDisplay(dname))) {
97
 
        pa_log("XOpenDisplay() failed");
 
100
        pa_log(_("XOpenDisplay() failed"));
98
101
        goto finish;
99
102
    }
100
103
 
102
105
        case DUMP: {
103
106
            char t[1024];
104
107
            if (pa_x11_get_prop(d, "PULSE_SERVER", t, sizeof(t)))
105
 
                printf("Server: %s\n", t);
 
108
                printf(_("Server: %s\n"), t);
106
109
            if (pa_x11_get_prop(d, "PULSE_SOURCE", t, sizeof(t)))
107
 
                printf("Source: %s\n", t);
 
110
                printf(_("Source: %s\n"), t);
108
111
            if (pa_x11_get_prop(d, "PULSE_SINK", t, sizeof(t)))
109
 
                printf("Sink: %s\n", t);
 
112
                printf(_("Sink: %s\n"), t);
110
113
            if (pa_x11_get_prop(d, "PULSE_COOKIE", t, sizeof(t)))
111
 
                printf("Cookie: %s\n", t);
 
114
                printf(_("Cookie: %s\n"), t);
112
115
 
113
116
            break;
114
117
        }
126
129
                uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
127
130
                size_t l;
128
131
                if ((l = pa_parsehex(t, cookie, sizeof(cookie))) != sizeof(cookie)) {
129
 
                    fprintf(stderr, "Failed to parse cookie data\n");
 
132
                    fprintf(stderr, _("Failed to parse cookie data\n"));
130
133
                    goto finish;
131
134
                }
132
135
 
133
136
                if (pa_authkey_save(cookie_file, cookie, l) < 0) {
134
 
                    fprintf(stderr, "Failed to save cookie data\n");
 
137
                    fprintf(stderr, _("Failed to save cookie data\n"));
135
138
                    goto finish;
136
139
                }
137
140
            }
146
149
            assert(conf);
147
150
 
148
151
            if (pa_client_conf_load(conf, NULL) < 0) {
149
 
                fprintf(stderr, "Failed to load client configuration file.\n");
 
152
                fprintf(stderr, _("Failed to load client configuration file.\n"));
150
153
                goto finish;
151
154
            }
152
155
 
153
156
            if (pa_client_conf_env(conf) < 0) {
154
 
                fprintf(stderr, "Failed to read environment configuration data.\n");
 
157
                fprintf(stderr, _("Failed to read environment configuration data.\n"));
155
158
                goto finish;
156
159
            }
157
160
 
168
171
            else {
169
172
                char hn[256];
170
173
                if (!pa_get_fqdn(hn, sizeof(hn))) {
171
 
                    fprintf(stderr, "Failed to get FQDN.\n");
 
174
                    fprintf(stderr, _("Failed to get FQDN.\n"));
172
175
                    goto finish;
173
176
                }
174
177
 
188
191
            pa_client_conf_free(conf);
189
192
 
190
193
            if (pa_authkey_load_auto(cookie_file, cookie, sizeof(cookie)) < 0) {
191
 
                fprintf(stderr, "Failed to load cookie data\n");
 
194
                fprintf(stderr, _("Failed to load cookie data\n"));
192
195
                goto finish;
193
196
            }
194
197
 
205
208
            break;
206
209
 
207
210
        default:
208
 
            fprintf(stderr, "No yet implemented.\n");
 
211
            fprintf(stderr, _("Not yet implemented.\n"));
209
212
            goto finish;
210
213
    }
211
214