~peter-pearse/ubuntu/oneiric/alsa-lib/prop001

« back to all changes in this revision

Viewing changes to src/control/tlv.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich, David Henningsson, Luke Yelavich
  • Date: 2011-02-21 18:08:28 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20110221180828-rlgpqym7u9gb8y3r
Tags: 1.0.24.1-0ubuntu1
[ David Henningsson ]
* New upstream version.
* Dropped patches:
  - thread-specific-locale.patch
  - thread-safe-locale.patch
  - lp652035-fix-missing-hw-devices.patch
  - refcount-dlobjs.patch
  - libtool-out-of-tree.patch

[ Luke Yelavich ]
* debian/changelog.ALSA: Updated
* debian/rules:
  - Bumped shlibs
  - Create usr/share/alsa/ucm directory to satisfy the alsaucm utility
* debian/control: Update Vcs-bzr field to point to new branch location

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
        }
168
168
        case SND_CTL_TLVT_DB_SCALE: {
169
169
                int step;
170
 
                *min = (int)tlv[2];
 
170
                if (tlv[3] & 0x10000)
 
171
                        *min = SND_CTL_TLV_DB_GAIN_MUTE;
 
172
                else
 
173
                        *min = (int)tlv[2];
171
174
                step = (tlv[3] & 0xffff);
172
 
                *max = *min + (long)(step * (rangemax - rangemin));
 
175
                *max = (int)tlv[2] + step * (rangemax - rangemin);
173
176
                return 0;
174
177
        }
175
178
        case SND_CTL_TLVT_DB_MINMAX:
 
179
        case SND_CTL_TLVT_DB_LINEAR:
 
180
                *min = (int)tlv[2];
 
181
                *max = (int)tlv[3];
 
182
                return 0;
176
183
        case SND_CTL_TLVT_DB_MINMAX_MUTE:
177
 
        case SND_CTL_TLVT_DB_LINEAR:
178
 
                *min = (int)tlv[2];
 
184
                *min = SND_CTL_TLV_DB_GAIN_MUTE;
179
185
                *max = (int)tlv[3];
180
186
                return 0;
181
187
        }
217
223
                min = tlv[2];
218
224
                step = (tlv[3] & 0xffff);
219
225
                mute = (tlv[3] >> 16) & 1;
220
 
                if (mute && volume == rangemin)
 
226
                if (mute && volume <= rangemin)
221
227
                        *db_gain = SND_CTL_TLV_DB_GAIN_MUTE;
222
228
                else
223
229
                        *db_gain = (volume - rangemin) * step + min;
327
333
                step = (tlv[3] & 0xffff);
328
334
                max = min + (int)(step * (rangemax - rangemin));
329
335
                if (db_gain <= min)
330
 
                        *value = rangemin;
 
336
                        if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE && xdir > 0 &&
 
337
                            (tlv[3] & 0x10000))
 
338
                                *value = rangemin + 1;
 
339
                        else
 
340
                                *value = rangemin;
331
341
                else if (db_gain >= max)
332
342
                        *value = rangemax;
333
343
                else {
345
355
                min = tlv[2];
346
356
                max = tlv[3];
347
357
                if (db_gain <= min)
348
 
                        *value = rangemin;
 
358
                        if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE && xdir > 0 &&
 
359
                            tlv[0] == SND_CTL_TLVT_DB_MINMAX_MUTE)
 
360
                                *value = rangemin + 1;
 
361
                        else
 
362
                                *value = rangemin;
349
363
                else if (db_gain >= max)
350
364
                        *value = rangemax;
351
365
                else {