summaryrefslogtreecommitdiff
path: root/apps/codecs/shorten.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-08-28 07:45:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-08-28 07:45:35 +0000
commit7ad2cad173ffa094bb285112582afee1c9aea4e5 (patch)
treece23e816cfdffb1767ebe44f4f960c304d8a5fb9 /apps/codecs/shorten.c
parent463b3ed8b2630d1b9d656dd2a52bbcbd429b4c08 (diff)
downloadrockbox-7ad2cad173ffa094bb285112582afee1c9aea4e5.tar.gz
rockbox-7ad2cad173ffa094bb285112582afee1c9aea4e5.zip
Commit work started in FS#12153 to put timing/position information in PCM
buffer chunks. * Samples and position indication is closely associated with audio data instead of compensating by a latency constant. Alleviates problems with using the elapsed as a track indicator where it could be off by several steps. * Timing is accurate throughout track even if resampling for pitch shift, whereas before it updated during transition latency at the normal 1:1 rate. * Simpler PCM buffer with a constant chunk size, no linked lists. In converting crossfade, a minor change was made to not change the WPS until the fade-in of the incoming track, whereas before it would change upon the start of the fade-out of the outgoing track possibly having the WPS change with far too much lead time. Codec changes are to set elapsed times *before* writing next PCM frame because time and position data last set are saved in the next committed PCM chunk. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30366 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/shorten.c')
-rw-r--r--apps/codecs/shorten.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c
index db66991679..a8ab3f30a0 100644
--- a/apps/codecs/shorten.c
+++ b/apps/codecs/shorten.c
@@ -99,6 +99,8 @@ enum codec_status codec_run(void)
99 sc.bitindex = sc.gb.index - 8*consumed; 99 sc.bitindex = sc.gb.index - 8*consumed;
100 100
101seek_start: 101seek_start:
102 ci->set_elapsed(0);
103
102 /* The main decoding loop */ 104 /* The main decoding loop */
103 ci->memset(&decoded0, 0, sizeof(int32_t)*MAX_DECODE_SIZE); 105 ci->memset(&decoded0, 0, sizeof(int32_t)*MAX_DECODE_SIZE);
104 ci->memset(&decoded1, 0, sizeof(int32_t)*MAX_DECODE_SIZE); 106 ci->memset(&decoded1, 0, sizeof(int32_t)*MAX_DECODE_SIZE);
@@ -118,7 +120,6 @@ seek_start:
118 if (param == 0 && 120 if (param == 0 &&
119 ci->seek_buffer(sc.header_bits/8 + ci->id3->first_frame_offset)) { 121 ci->seek_buffer(sc.header_bits/8 + ci->id3->first_frame_offset)) {
120 sc.bitindex = sc.header_bits - 8*(sc.header_bits/8); 122 sc.bitindex = sc.header_bits - 8*(sc.header_bits/8);
121 ci->set_elapsed(0);
122 ci->seek_complete(); 123 ci->seek_complete();
123 goto seek_start; 124 goto seek_start;
124 } 125 }