]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually...
authorLennart Poettering <mznyfn@0pointer.de>
Fri, 18 Jul 2008 19:24:38 +0000 (21:24 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 20 Jul 2008 15:27:57 +0000 (17:27 +0200)
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>
src/pcm/pcm_plugin.c

index b377cb223cd96e58f5b065bace659f147edff66f..c4f5b4aa2fa09aaa0bf350994aa0632e179583b7 100644 (file)
@@ -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,