~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/modules/oss-util.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: oss-util.c 2037 2007-11-09 02:45:07Z lennart $ */
2
 
 
3
1
/***
4
2
  This file is part of PulseAudio.
5
3
 
206
204
 
207
205
    if (ss->channels != channels) {
208
206
        pa_log_warn("device doesn't support %i channels, using %i channels.", ss->channels, channels);
209
 
        ss->channels = channels;
 
207
        ss->channels = (uint8_t) channels;
210
208
    }
211
209
 
212
 
    speed = ss->rate;
 
210
    speed = (int) ss->rate;
213
211
    if (ioctl(fd, SNDCTL_DSP_SPEED, &speed) < 0) {
214
212
        pa_log("SNDCTL_DSP_SPEED: %s", pa_cstrerror(errno));
215
213
        return -1;
221
219
 
222
220
        /* If the sample rate deviates too much, we need to resample */
223
221
        if (speed < ss->rate*.95 || speed > ss->rate*1.05)
224
 
            ss->rate = speed;
 
222
            ss->rate = (uint32_t) speed;
225
223
    }
226
224
 
227
225
    return 0;
251
249
    return 0;
252
250
}
253
251
 
254
 
int pa_oss_get_volume(int fd, int mixer, const pa_sample_spec *ss, pa_cvolume *volume) {
 
252
int pa_oss_get_volume(int fd, unsigned long mixer, const pa_sample_spec *ss, pa_cvolume *volume) {
255
253
    char cv[PA_CVOLUME_SNPRINT_MAX];
256
254
    unsigned vol;
257
255
 
273
271
    return 0;
274
272
}
275
273
 
276
 
int pa_oss_set_volume(int fd, long mixer, const pa_sample_spec *ss, const pa_cvolume *volume) {
 
274
int pa_oss_set_volume(int fd, unsigned long mixer, const pa_sample_spec *ss, const pa_cvolume *volume) {
277
275
    char cv[PA_CVOLUME_SNPRINT_MAX];
278
276
    unsigned vol;
279
277
    pa_volume_t l, r;