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

« back to all changes in this revision

Viewing changes to src/pulse/sample.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: sample.c 1971 2007-10-28 19:13:50Z lennart $ */
 
1
/* $Id: sample.c 2037 2007-11-09 02:45:07Z lennart $ */
2
2
 
3
3
/***
4
4
  This file is part of PulseAudio.
44
44
        [PA_SAMPLE_S16LE] = 2,
45
45
        [PA_SAMPLE_S16BE] = 2,
46
46
        [PA_SAMPLE_FLOAT32LE] = 4,
47
 
        [PA_SAMPLE_FLOAT32BE] = 4
 
47
        [PA_SAMPLE_FLOAT32BE] = 4,
 
48
        [PA_SAMPLE_S32LE] = 4,
 
49
        [PA_SAMPLE_S32BE] = 4,
48
50
    };
49
51
 
50
52
    pa_assert(spec);
107
109
        [PA_SAMPLE_S16BE] = "s16be",
108
110
        [PA_SAMPLE_FLOAT32LE] = "float32le",
109
111
        [PA_SAMPLE_FLOAT32BE] = "float32be",
 
112
        [PA_SAMPLE_S32LE] = "s32le",
 
113
        [PA_SAMPLE_S32BE] = "s32be",
110
114
    };
111
115
 
112
116
    if (f < 0 || f >= PA_SAMPLE_MAX)
156
160
        return PA_SAMPLE_S16RE;
157
161
    else if (strcasecmp(format, "u8") == 0 || strcasecmp(format, "8") == 0)
158
162
        return PA_SAMPLE_U8;
159
 
    else if (strcasecmp(format, "float32") == 0 || strcasecmp(format, "float32ne") == 0)
 
163
    else if (strcasecmp(format, "float32") == 0 || strcasecmp(format, "float32ne") == 0 || strcasecmp(format, "float") == 0)
160
164
        return PA_SAMPLE_FLOAT32NE;
161
165
    else if (strcasecmp(format, "float32re") == 0)
162
166
        return PA_SAMPLE_FLOAT32RE;
168
172
        return PA_SAMPLE_ULAW;
169
173
    else if (strcasecmp(format, "alaw") == 0)
170
174
        return PA_SAMPLE_ALAW;
 
175
    else if (strcasecmp(format, "s32le") == 0)
 
176
        return PA_SAMPLE_S32LE;
 
177
    else if (strcasecmp(format, "s32be") == 0)
 
178
        return PA_SAMPLE_S32BE;
 
179
    else if (strcasecmp(format, "s32ne") == 0 || strcasecmp(format, "s32") == 0 || strcasecmp(format, "32") == 0)
 
180
        return PA_SAMPLE_S32NE;
 
181
    else if (strcasecmp(format, "s32re") == 0)
 
182
        return PA_SAMPLE_S32RE;
171
183
 
172
184
    return -1;
173
185
}