forked from len0rd/rockbox
Enhance seeking in a52_rm ; it was a bit choppy, and fix a bug (request_buffer was called after eos and gave a seg fault) by changing the the
condition for the decoding loop. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22162 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2b3b36a480
commit
ac2ce3a449
1 changed files with 4 additions and 3 deletions
|
|
@ -157,15 +157,16 @@ next_track:
|
|||
ci->advance_buffer(rmctx.data_offset + DATA_HEADER_SIZE );
|
||||
|
||||
/* The main decoding loop */
|
||||
while(pkt.timestamp < rmctx.duration) {
|
||||
while(rmctx.audio_pkt_cnt < rmctx.nb_packets) {
|
||||
ci->yield();
|
||||
if (ci->stop_codec || ci->new_track)
|
||||
break;
|
||||
|
||||
if (ci->seek_time) {
|
||||
packet_offset = ci->seek_time / (((rmctx.block_align + PACKET_HEADER_SIZE)*8*1000)/rmctx.bit_rate);
|
||||
packet_offset = ci->seek_time / ((rmctx.block_align*8*1000)/rmctx.bit_rate);
|
||||
ci->seek_buffer(rmctx.data_offset + DATA_HEADER_SIZE + packet_offset*(rmctx.block_align + PACKET_HEADER_SIZE));
|
||||
samplesdone = A52_SAMPLESPERFRAME * packet_offset;
|
||||
rmctx.audio_pkt_cnt = packet_offset;
|
||||
samplesdone = (rmctx.sample_rate/1000 * ci->seek_time);
|
||||
ci->seek_complete();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue