~ubuntu-branches/ubuntu/oneiric/pulseaudio/oneiric

« back to all changes in this revision

Viewing changes to src/pulsecore/module.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-12-04 00:56:08 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071204005608-y1xqvcu45g1yxtlu
Tags: 0.9.8-1ubuntu1
"Hail our new PulseAudio overlords (part two)."

* Merge from Debian unstable.
* Ubuntu-specific changes:
  - debian/control:
    + Don't build-depend on libjack0.100.0-dev or build jack module
      packages,
    + Update pulseaudio's Recommends and Suggests to accomodate
      existing promoted main packages,
    + Explicitly mention pasuspender in pulseaudio-utils's long
      description,
    + Add Vcs-Bzr URI,
    + Adhere to DebianMaintainerField;
  - debian/rules: Use multiuser for update-rc.d;
  - debian/patches/series: Retain the exclusion of
    0001-Set-ESD-socket-to-tmp-.esd-socket-to-match-up-with.patch.
* Dropped Ubuntu-specific change (absorbed into Debian source):
  debian/patches/0002-Double-esound-maximum-sample-size.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: module.c 1971 2007-10-28 19:13:50Z lennart $ */
 
1
/* $Id: module.c 2049 2007-11-13 17:35:48Z lennart $ */
2
2
 
3
3
/***
4
4
  This file is part of PulseAudio.
46
46
 
47
47
#define PA_SYMBOL_INIT "pa__init"
48
48
#define PA_SYMBOL_DONE "pa__done"
 
49
#define PA_SYMBOL_LOAD_ONCE "pa__load_once"
49
50
 
50
51
#define UNLOAD_POLL_TIME 2
51
52
 
66
67
 
67
68
pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
68
69
    pa_module *m = NULL;
 
70
    pa_bool_t (*load_once)(void);
69
71
 
70
72
    pa_assert(c);
71
73
    pa_assert(name);
82
84
        goto fail;
83
85
    }
84
86
 
 
87
    if ((load_once = (pa_bool_t (*)(void)) pa_load_sym(m->dl, name, PA_SYMBOL_LOAD_ONCE))) {
 
88
 
 
89
        if (load_once() && c->modules) {
 
90
            pa_module *i;
 
91
            uint32_t idx;
 
92
            /* OK, the module only wants to be loaded once, let's make sure it is */
 
93
 
 
94
            for (i = pa_idxset_first(c->modules, &idx); i; i = pa_idxset_next(c->modules, &idx)) {
 
95
                if (strcmp(name, i->name) == 0) {
 
96
                    pa_log("Module \"%s\" should be loaded once at most. Refusing to load.", name);
 
97
                    goto fail;
 
98
                }
 
99
            }
 
100
        }
 
101
    }
 
102
 
85
103
    if (!(m->init = (int (*)(pa_module*_m)) pa_load_sym(m->dl, name, PA_SYMBOL_INIT))) {
86
104
        pa_log("Failed to load module \"%s\": symbol \""PA_SYMBOL_INIT"\" not found.", name);
87
105
        goto fail;