summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-10-22 21:07:35 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-10-22 21:07:35 +0000
commitbdf558ca53f293aa112c36b7662a092abdc9f5d5 (patch)
treef3acccdb3281a66d8f2d4996d93cca05f053d81c
parent6f9a84c2b872c1a7c5e73869a6e0f2a0353b3efa (diff)
downloadrockbox-bdf558ca53f293aa112c36b7662a092abdc9f5d5.tar.gz
rockbox-bdf558ca53f293aa112c36b7662a092abdc9f5d5.zip
Fixed the voice codec when no audio is playing. Now attenuating audio
instead of making the voice louder. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7653 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/pcmbuf.c2
-rw-r--r--apps/playback.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index b67e889a95..8ab4ffaae1 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -652,7 +652,7 @@ void pcmbuf_mix(char *buf, long length)
652 length /= 2; 652 length /= 2;
653 653
654 while (length-- > 0) { 654 while (length-- > 0) {
655 obuf[mixpos] = MIN(MAX(obuf[mixpos] + *ibuf*4, -32768), 32767); 655 obuf[mixpos] = MIN(MAX(obuf[mixpos]/4 + *ibuf, -32768), 32767);
656 656
657 ibuf++; 657 ibuf++;
658 mixpos++; 658 mixpos++;
diff --git a/apps/playback.c b/apps/playback.c
index 7c3d63c5a8..99d58d8136 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -297,13 +297,13 @@ bool codec_pcmbuf_insert_split_callback(void *ch1, void *ch2,
297 297
298 while (length > 0) { 298 while (length > 0) {
299 /* This will prevent old audio from playing when skipping tracks. */ 299 /* This will prevent old audio from playing when skipping tracks. */
300 if (ci.reload_codec || ci.stop_codec) 300 if ((ci.reload_codec || ci.stop_codec) && current_codec != CODEC_IDX_VOICE)
301 return true; 301 return true;
302 302
303 while ((dest = pcmbuf_request_buffer(dsp_output_size(length), 303 while ((dest = pcmbuf_request_buffer(dsp_output_size(length),
304 &output_size)) == NULL) { 304 &output_size)) == NULL) {
305 sleep(1); 305 sleep(1);
306 if (ci.reload_codec || ci.stop_codec) 306 if ((ci.reload_codec || ci.stop_codec) && current_codec != CODEC_IDX_VOICE)
307 return true; 307 return true;
308 } 308 }
309 309
@@ -1676,7 +1676,7 @@ void audio_thread(void)
1676 1676
1677 playlist_update_resume_info(audio_current_track()); 1677 playlist_update_resume_info(audio_current_track());
1678 1678
1679 /* If there are no tracks in the playlist, then the playlist 1679 /* If there are no tracks in the playlist, then the playlist
1680 was empty or none of the filenames were valid. No point 1680 was empty or none of the filenames were valid. No point
1681 in playing an empty playlist. */ 1681 in playing an empty playlist. */
1682 if (playlist_amount() == 0) { 1682 if (playlist_amount() == 0) {