summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/alsa-lib/files')
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch38
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch36
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch39
3 files changed, 113 insertions, 0 deletions
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch
new file mode 100644
index 000000000000..d3d6f9398f03
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward-return.patch
@@ -0,0 +1,38 @@
+From: Lennart Poettering <mznyfn@0pointer.de>
+Date: Fri, 18 Jul 2008 19:24:38 +0000 (+0200)
+Subject: fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually ...
+X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=8d3fb3102f672a7b09be92811e89d49f89c1742b
+
+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
+
+Make snd_pcm_plugin_rewind()/_forward() actually return how much has
+been rewound/forwarded instead of how much could have been
+rewounded/forwarded. This makes the code actually do what the
+documentation of snd_pcm_rewind() suggests.
+
+Signed-off-by: Lennart Poettering <lennart@poettering.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+
+diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
+index b377cb2..c4f5b4a 100644
+--- a/src/pcm/pcm_plugin.c
++++ b/src/pcm/pcm_plugin.c
+@@ -222,7 +222,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
+ frames = plugin->client_frames(pcm, sframes);
+ snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
+ snd_atomic_write_end(&plugin->watom);
+- return n;
++ return (snd_pcm_sframes_t) frames;
+ }
+
+ static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
+@@ -255,7 +255,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
+ frames = plugin->client_frames(pcm, sframes);
+ snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
+ snd_atomic_write_end(&plugin->watom);
+- return n;
++ return (snd_pcm_sframes_t) frames;
+ }
+
+ static snd_pcm_sframes_t snd_pcm_plugin_write_areas(snd_pcm_t *pcm,
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch
new file mode 100644
index 000000000000..80945aaa1a58
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.17-pcm-rewind-forward.patch
@@ -0,0 +1,36 @@
+From: Lennart Poettering <mznyfn@0pointer.de>
+Date: Fri, 18 Jul 2008 19:21:23 +0000 (+0200)
+Subject: clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
+X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6
+
+clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
+
+The clamping of the input parameter in snd_pcm_rewind()/_forward() is
+in the wrong direction.
+
+Signed-off-by: Lennart Poettering <lennart@poettering.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+
+diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
+index c73a02b..c199d8d 100644
+--- a/src/pcm/pcm_plugin.c
++++ b/src/pcm/pcm_plugin.c
+@@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
+ snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
+ snd_pcm_sframes_t sframes;
+
+- if ((snd_pcm_uframes_t)n > frames)
++ if ((snd_pcm_uframes_t)n < frames)
+ frames = n;
+ if (frames == 0)
+ return 0;
+@@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
+ snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
+ snd_pcm_uframes_t sframes;
+
+- if ((snd_pcm_uframes_t)n > frames)
++ if ((snd_pcm_uframes_t)n < frames)
+ frames = n;
+ if (frames == 0)
+ return 0;
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch
new file mode 100644
index 000000000000..e36c41b50962
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.17-sframe-type.patch
@@ -0,0 +1,39 @@
+From: Lennart Poettering <mznyfn@0pointer.de>
+Date: Fri, 18 Jul 2008 19:22:50 +0000 (+0200)
+Subject: fix type of internally used sframes variable, to avoid unnecessary casts
+X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=15769ead725b7c215dedd4ea5196955086d2044a
+
+fix type of internally used sframes variable, to avoid unnecessary casts
+
+This minor patch fixes the type of the sframes variable in
+snd_pcm_plugin_forward(). With this fix we need to cast less and the
+code is less confusing.
+
+Signed-off-by: Lennart Poettering <lennart@poettering.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+
+diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
+index c199d8d..b377cb2 100644
+--- a/src/pcm/pcm_plugin.c
++++ b/src/pcm/pcm_plugin.c
+@@ -234,7 +234,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
+ {
+ snd_pcm_plugin_t *plugin = pcm->private_data;
+ snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
+- snd_pcm_uframes_t sframes;
++ snd_pcm_sframes_t sframes;
+
+ if ((snd_pcm_uframes_t)n < frames)
+ frames = n;
+@@ -246,8 +246,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
+ else
+ sframes = frames;
+ snd_atomic_write_begin(&plugin->watom);
+- sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, (snd_pcm_uframes_t) sframes);
+- if ((snd_pcm_sframes_t) sframes < 0) {
++ sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
++ if (sframes < 0) {
+ snd_atomic_write_end(&plugin->watom);
+ return sframes;
+ }