summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/sdl
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-24 16:42:32 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-24 16:42:32 +0000
commitd56999890f2aacf197d9ae4383313271499509a9 (patch)
tree76a0177e2cf19bb15a065199b812ef20158422e1 /firmware/target/hosted/sdl
parent6688988ec42aa2254c8e370ec1932033a258b6fa (diff)
downloadrockbox-d56999890f2aacf197d9ae4383313271499509a9.tar.gz
rockbox-d56999890f2aacf197d9ae4383313271499509a9.zip
Make PCM->driver interface about as simple as it will get. Registered callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted/sdl')
-rw-r--r--firmware/target/hosted/sdl/pcm-sdl.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/firmware/target/hosted/sdl/pcm-sdl.c b/firmware/target/hosted/sdl/pcm-sdl.c
index ee92fa208d..03e6e1336c 100644
--- a/firmware/target/hosted/sdl/pcm-sdl.c
+++ b/firmware/target/hosted/sdl/pcm-sdl.c
@@ -228,15 +228,9 @@ static void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
/* Audio card wants more? Get some more then. */
while (len > 0) {
- if ((ssize_t)pcm_data_size <= 0) {
- pcm_data_size = 0;
-
- if (pcm_callback_for_more)
- pcm_callback_for_more(&pcm_data, &pcm_data_size);
- }
-
- if (pcm_data_size > 0) {
+ pcm_play_get_more_callback(&pcm_data, &pcm_data_size);
start:
+ if (pcm_data_size != 0) {
udata->num_in = pcm_data_size / pcm_sample_bytes;
udata->num_out = len / pcm_sample_bytes;
@@ -251,8 +245,6 @@ static void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
len -= udata->num_out;
} else {
DEBUGF("sdl_audio_callback: No Data.\n");
- pcm_play_dma_stop();
- pcm_play_dma_stopped_callback();
break;
}
}
@@ -292,12 +284,6 @@ void pcm_rec_dma_stop(void)
{
}
-void pcm_rec_dma_record_more(void *start, size_t size)
-{
- (void)start;
- (void)size;
-}
-
unsigned long pcm_rec_status(void)
{
return 0;