Gentoo Archives: gentoo-commits

From: "Patrick McLean (chutzpah)" <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/alsa-lib/files: alsa-lib-1.0.17-pcm-rewind-forward-return.patch alsa-lib-1.0.17-sframe-type.patch alsa-lib-1.0.17-pcm-rewind-forward.patch
Date: Sun, 03 Aug 2008 17:12:37
Message-Id: E1KPh8E-0003vL-RN@stork.gentoo.org
1 chutzpah 08/08/03 17:12:34
2
3 Added: alsa-lib-1.0.17-pcm-rewind-forward-return.patch
4 alsa-lib-1.0.17-sframe-type.patch
5 alsa-lib-1.0.17-pcm-rewind-forward.patch
6 Log:
7 Add three patches from upstream ALSA git for pulseaudio (bug #233789). Betelgeuse confirmed this bump with Chainsaw.
8 (Portage version: 2.2_rc6/cvs/Linux 2.6.26-gentoo x86_64)
9
10 Revision Changes Path
11 1.1 media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch?rev=1.1&content-type=text/plain
15
16 Index: alsa-lib-1.0.17-pcm-rewind-forward-return.patch
17 ===================================================================
18 From: Lennart Poettering <mznyfn@××××××××.de>
19 Date: Fri, 18 Jul 2008 19:24:38 +0000 (+0200)
20 Subject: fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually ...
21 X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=8d3fb3102f672a7b09be92811e89d49f89c1742b
22
23 fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually has been rewound, instead of what actually could have rewound
24
25 Make snd_pcm_plugin_rewind()/_forward() actually return how much has
26 been rewound/forwarded instead of how much could have been
27 rewounded/forwarded. This makes the code actually do what the
28 documentation of snd_pcm_rewind() suggests.
29
30 Signed-off-by: Lennart Poettering <lennart@××××××××××.net>
31 Signed-off-by: Takashi Iwai <tiwai@××××.de>
32 ---
33
34 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
35 index b377cb2..c4f5b4a 100644
36 --- a/src/pcm/pcm_plugin.c
37 +++ b/src/pcm/pcm_plugin.c
38 @@ -222,7 +222,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
39 frames = plugin->client_frames(pcm, sframes);
40 snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
41 snd_atomic_write_end(&plugin->watom);
42 - return n;
43 + return (snd_pcm_sframes_t) frames;
44 }
45
46 static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
47 @@ -255,7 +255,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
48 frames = plugin->client_frames(pcm, sframes);
49 snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
50 snd_atomic_write_end(&plugin->watom);
51 - return n;
52 + return (snd_pcm_sframes_t) frames;
53 }
54
55 static snd_pcm_sframes_t snd_pcm_plugin_write_areas(snd_pcm_t *pcm,
56
57
58
59 1.1 media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch
60
61 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch?rev=1.1&view=markup
62 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch?rev=1.1&content-type=text/plain
63
64 Index: alsa-lib-1.0.17-sframe-type.patch
65 ===================================================================
66 From: Lennart Poettering <mznyfn@××××××××.de>
67 Date: Fri, 18 Jul 2008 19:22:50 +0000 (+0200)
68 Subject: fix type of internally used sframes variable, to avoid unnecessary casts
69 X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=15769ead725b7c215dedd4ea5196955086d2044a
70
71 fix type of internally used sframes variable, to avoid unnecessary casts
72
73 This minor patch fixes the type of the sframes variable in
74 snd_pcm_plugin_forward(). With this fix we need to cast less and the
75 code is less confusing.
76
77 Signed-off-by: Lennart Poettering <lennart@××××××××××.net>
78 Signed-off-by: Takashi Iwai <tiwai@××××.de>
79 ---
80
81 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
82 index c199d8d..b377cb2 100644
83 --- a/src/pcm/pcm_plugin.c
84 +++ b/src/pcm/pcm_plugin.c
85 @@ -234,7 +234,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
86 {
87 snd_pcm_plugin_t *plugin = pcm->private_data;
88 snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
89 - snd_pcm_uframes_t sframes;
90 + snd_pcm_sframes_t sframes;
91
92 if ((snd_pcm_uframes_t)n < frames)
93 frames = n;
94 @@ -246,8 +246,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
95 else
96 sframes = frames;
97 snd_atomic_write_begin(&plugin->watom);
98 - sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, (snd_pcm_uframes_t) sframes);
99 - if ((snd_pcm_sframes_t) sframes < 0) {
100 + sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
101 + if (sframes < 0) {
102 snd_atomic_write_end(&plugin->watom);
103 return sframes;
104 }
105
106
107
108 1.1 media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch
109
110 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch?rev=1.1&view=markup
111 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch?rev=1.1&content-type=text/plain
112
113 Index: alsa-lib-1.0.17-pcm-rewind-forward.patch
114 ===================================================================
115 From: Lennart Poettering <mznyfn@××××××××.de>
116 Date: Fri, 18 Jul 2008 19:21:23 +0000 (+0200)
117 Subject: clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
118 X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6
119
120 clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
121
122 The clamping of the input parameter in snd_pcm_rewind()/_forward() is
123 in the wrong direction.
124
125 Signed-off-by: Lennart Poettering <lennart@××××××××××.net>
126 Signed-off-by: Takashi Iwai <tiwai@××××.de>
127 ---
128
129 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
130 index c73a02b..c199d8d 100644
131 --- a/src/pcm/pcm_plugin.c
132 +++ b/src/pcm/pcm_plugin.c
133 @@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
134 snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
135 snd_pcm_sframes_t sframes;
136
137 - if ((snd_pcm_uframes_t)n > frames)
138 + if ((snd_pcm_uframes_t)n < frames)
139 frames = n;
140 if (frames == 0)
141 return 0;
142 @@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
143 snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
144 snd_pcm_uframes_t sframes;
145
146 - if ((snd_pcm_uframes_t)n > frames)
147 + if ((snd_pcm_uframes_t)n < frames)
148 frames = n;
149 if (frames == 0)
150 return 0;