~ubuntu-branches/ubuntu/intrepid/alsa-lib/intrepid

« back to all changes in this revision

Viewing changes to debian/patches/fix_ioplug.patch

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2008-03-11 23:31:24 UTC
  • Revision ID: james.westby@ubuntu.com-20080311233124-f1yvj5o7162murun
Tags: 1.0.15-3ubuntu4
* Backport fixes from hg tip (no API/ABI changes):
  - fix_sem_deadlock_in_dmix.patch (LP: #190059),
  - fix_const_casts.patch,
  - fix_ioplug.patch,
  - fix_control_range.patch,
  - dont_use_hackish_callback_in_rate_plugin.patch,
  - fix_cpu_hog_in_rate_plug.patch,
  - fix_mmap_with_multi_plug.patch,
  - fix_wrong_return_values_in_direct_plug.patch,
  - fix_timestamp_in_status_pcm_direct_plug.patch,
  - fix_configs_error_handling.patch,
  - fix_not_updated_bit_set.patch,
  - fix_device_assignment.patch,
  - fix_missing_aliases.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: alsa-lib-1.0.15/src/pcm/pcm_ioplug.c
 
2
===================================================================
 
3
--- alsa-lib-1.0.15.orig/src/pcm/pcm_ioplug.c   2008-03-11 18:22:04.000000000 -0400
 
4
+++ alsa-lib-1.0.15/src/pcm/pcm_ioplug.c        2008-03-11 18:25:07.000000000 -0400
 
5
@@ -313,7 +313,7 @@
 
6
                if (err < 0)
 
7
                        return err;
 
8
                change2 |= err;
 
9
-               /* periods = buffer_bytes / periods */
 
10
+               /* periods = buffer_bytes / period_bytes */
 
11
                err = rule_div(params, SND_PCM_HW_PARAM_PERIODS,
 
12
                               SND_PCM_HW_PARAM_BUFFER_BYTES,
 
13
                               SND_PCM_HW_PARAM_PERIOD_BYTES);
 
14
@@ -344,6 +344,26 @@
 
15
                        return err;
 
16
        }
 
17
 
 
18
+       /* period_bytes = buffer_bytes / periods */
 
19
+       err = rule_div(params, SND_PCM_HW_PARAM_PERIOD_BYTES,
 
20
+                      SND_PCM_HW_PARAM_BUFFER_BYTES,
 
21
+                      SND_PCM_HW_PARAM_PERIODS);
 
22
+       if (err < 0)
 
23
+               return err;
 
24
+       if (err) {
 
25
+               /* update period_size and period_time */
 
26
+               change |= err;
 
27
+               err = snd_ext_parm_interval_refine(hw_param_interval(params, SND_PCM_HW_PARAM_PERIOD_BYTES),
 
28
+                                                  io->params, SND_PCM_IOPLUG_HW_PERIOD_BYTES);
 
29
+               if (err < 0)
 
30
+                       return err;
 
31
+               err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_PERIOD_TIME,
 
32
+                                               SND_PCM_HW_PARAM_PERIOD_SIZE,
 
33
+                                               SND_PCM_HW_PARAM_PERIOD_BYTES);
 
34
+               if (err < 0)
 
35
+                       return err;
 
36
+       }
 
37
+
 
38
        params->info = SND_PCM_INFO_BLOCK_TRANSFER;
 
39
        p = &io->params[SND_PCM_IOPLUG_HW_ACCESS];
 
40
        if (p->active) {
 
41
@@ -469,7 +489,7 @@
 
42
 {
 
43
        ioplug_priv_t *io = pcm->private_data;
 
44
        static snd_pcm_state_t states[2] = {
 
45
-               SND_PCM_STATE_PAUSED, SND_PCM_STATE_RUNNING
 
46
+               SND_PCM_STATE_RUNNING, SND_PCM_STATE_PAUSED
 
47
        };
 
48
        int prev, err;
 
49