~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/modules/module-match.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: module-match.c 2043 2007-11-09 18:25:40Z lennart $ */
2
 
 
3
1
/***
4
2
  This file is part of PulseAudio.
5
3
 
82
80
 
83
81
    pa_assert(u);
84
82
 
85
 
    f = filename ?
86
 
        fopen(fn = pa_xstrdup(filename), "r") :
87
 
        pa_open_config_file(DEFAULT_MATCH_TABLE_FILE, DEFAULT_MATCH_TABLE_FILE_USER, NULL, &fn, "r");
 
83
    if (filename)
 
84
        f = fopen(fn = pa_xstrdup(filename), "r");
 
85
    else
 
86
        f = pa_open_config_file(DEFAULT_MATCH_TABLE_FILE, DEFAULT_MATCH_TABLE_FILE_USER, NULL, &fn);
88
87
 
89
88
    if (!f) {
90
 
        pa_log("failed to open file '%s': %s", fn, pa_cstrerror(errno));
 
89
        pa_xfree(fn);
 
90
        pa_log("Failed to open file config file: %s", pa_cstrerror(errno));
91
91
        goto finish;
92
92
    }
93
93
 
166
166
    struct userdata *u =  userdata;
167
167
    pa_sink_input *si;
168
168
    struct rule *r;
 
169
    const char *n;
169
170
 
170
171
    pa_assert(c);
171
172
    pa_assert(u);
176
177
    if (!(si = pa_idxset_get_by_index(c->sink_inputs, idx)))
177
178
        return;
178
179
 
179
 
    if (!si->name)
 
180
    if (!(n = pa_proplist_gets(si->proplist, PA_PROP_MEDIA_NAME)))
180
181
        return;
181
182
 
182
183
    for (r = u->rules; r; r = r->next) {
183
 
        if (!regexec(&r->regex, si->name, 0, NULL, 0)) {
 
184
        if (!regexec(&r->regex, n, 0, NULL, 0)) {
184
185
            pa_cvolume cv;
185
 
            pa_log_debug("changing volume of sink input '%s' to 0x%03x", si->name, r->volume);
 
186
            pa_log_debug("changing volume of sink input '%s' to 0x%03x", n, r->volume);
186
187
            pa_cvolume_set(&cv, si->sample_spec.channels, r->volume);
187
188
            pa_sink_input_set_volume(si, &cv);
188
189
        }