summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-08-04 18:34:32 +0000
committerThomas Martitz <kugel@rockbox.org>2010-08-04 18:34:32 +0000
commitbd9c0b21d6209b687be5f0006c0d9dc68aefbccf (patch)
tree900f199596e0442f1e52753a0b225cceffb93664 /firmware/target/hosted
parentc216100f843d5ec0fba5a4f49907d666a65028b1 (diff)
downloadrockbox-bd9c0b21d6209b687be5f0006c0d9dc68aefbccf.tar.gz
rockbox-bd9c0b21d6209b687be5f0006c0d9dc68aefbccf.tar.bz2
rockbox-bd9c0b21d6209b687be5f0006c0d9dc68aefbccf.zip
A bit of work in the pcm driver. Should be a bit more efficient, but more importantly more dependable. Stopping playback now properly recovers if playback crashed for some reason (shouldn't happen of course).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27698 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted')
-rw-r--r--firmware/target/hosted/android/pcm-android.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c
index 8c5d2597c4..649b42d421 100644
--- a/firmware/target/hosted/android/pcm-android.c
+++ b/firmware/target/hosted/android/pcm-android.c
@@ -72,7 +72,10 @@ Java_org_rockbox_RockboxPCM_pcmSamplesToByteArray(JNIEnv *env,
retry:
pcm_play_get_more_callback((void**)&pcm_data_start, &pcm_data_size);
if (pcm_data_size == 0)
+ {
+ LOG("out of data\n");
return;
+ }
if (remaining > pcm_data_size)
{ /* got too little data, get more ... */
(*env)->SetByteArrayRegion(env, arr, offset, pcm_data_size, pcm_data_start);
@@ -80,6 +83,7 @@ Java_org_rockbox_RockboxPCM_pcmSamplesToByteArray(JNIEnv *env,
offset += pcm_data_size;
/* we copied at least a bit */
remaining -= pcm_data_size;
+ pcm_data_size = 0;
/* let's get another buch of data and try again */
goto retry;
}