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

« back to all changes in this revision

Viewing changes to src/pulsecore/source.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: source.c 1971 2007-10-28 19:13:50Z lennart $ */
 
1
/* $Id: source.c 2067 2007-11-21 01:30:40Z lennart $ */
2
2
 
3
3
/***
4
4
  This file is part of PulseAudio.
126
126
 
127
127
static int source_set_state(pa_source *s, pa_source_state_t state) {
128
128
    int ret;
 
129
    pa_bool_t suspend_change;
129
130
 
130
131
    pa_assert(s);
131
132
 
132
133
    if (s->state == state)
133
134
        return 0;
134
135
 
135
 
    if ((s->state == PA_SOURCE_SUSPENDED && PA_SOURCE_OPENED(state)) ||
136
 
        (PA_SOURCE_OPENED(s->state) && state == PA_SOURCE_SUSPENDED)) {
 
136
    suspend_change =
 
137
        (s->state == PA_SOURCE_SUSPENDED && PA_SOURCE_OPENED(state)) ||
 
138
        (PA_SOURCE_OPENED(s->state) && state == PA_SOURCE_SUSPENDED);
 
139
 
 
140
    if (s->set_state)
 
141
        if ((ret = s->set_state(s, state)) < 0)
 
142
            return -1;
 
143
 
 
144
    if (pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL) < 0)
 
145
        return -1;
 
146
 
 
147
    s->state = state;
 
148
 
 
149
    if (suspend_change) {
137
150
        pa_source_output *o;
138
151
        uint32_t idx;
139
152
 
144
157
                o->suspend(o, state == PA_SINK_SUSPENDED);
145
158
    }
146
159
 
147
 
    if (s->set_state)
148
 
        if ((ret = s->set_state(s, state)) < 0)
149
 
            return -1;
150
 
 
151
 
    if (pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL) < 0)
152
 
        return -1;
153
 
 
154
 
    s->state = state;
155
 
 
156
160
    if (state != PA_SOURCE_UNLINKED) /* if we enter UNLINKED state pa_source_unlink() will fire the apropriate events */
157
161
        pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_STATE_CHANGED], s);
 
162
 
158
163
    return 0;
159
164
}
160
165