forked from len0rd/rockbox
Support resume for Musepack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13049 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8527ce82b6
commit
a5d7309d96
2 changed files with 17 additions and 1 deletions
|
|
@ -100,6 +100,8 @@ next_track:
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
samplesdone = ci->id3->offset;
|
||||||
|
|
||||||
/* read file's streaminfo data */
|
/* read file's streaminfo data */
|
||||||
mpc_streaminfo_init(&info);
|
mpc_streaminfo_init(&info);
|
||||||
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
|
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
|
||||||
|
|
@ -129,8 +131,20 @@ next_track:
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the decoding loop. */
|
/* Resume to saved sample offset. */
|
||||||
|
if(samplesdone > 0) {
|
||||||
|
/* hack to improve seek time if filebuf goes empty */
|
||||||
|
ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
|
||||||
|
if (mpc_decoder_seek_sample(&decoder, samplesdone)) {
|
||||||
|
ci->set_elapsed(samplesdone/frequency);
|
||||||
|
} else {
|
||||||
samplesdone = 0;
|
samplesdone = 0;
|
||||||
|
}
|
||||||
|
/* reset chunksize */
|
||||||
|
ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is the decoding loop. */
|
||||||
do {
|
do {
|
||||||
#if 1
|
#if 1
|
||||||
/* Complete seek handler. */
|
/* Complete seek handler. */
|
||||||
|
|
@ -173,6 +187,7 @@ next_track:
|
||||||
status);
|
status);
|
||||||
samplesdone += status;
|
samplesdone += status;
|
||||||
ci->set_elapsed(samplesdone/frequency);
|
ci->set_elapsed(samplesdone/frequency);
|
||||||
|
ci->set_offset(samplesdone);
|
||||||
}
|
}
|
||||||
} while (status != 0);
|
} while (status != 0);
|
||||||
retval = CODEC_OK;
|
retval = CODEC_OK;
|
||||||
|
|
|
||||||
|
|
@ -2855,6 +2855,7 @@ static bool audio_load_track(int offset, bool start_play, bool rebuffer)
|
||||||
case AFMT_PCM_WAV:
|
case AFMT_PCM_WAV:
|
||||||
case AFMT_A52:
|
case AFMT_A52:
|
||||||
case AFMT_AAC:
|
case AFMT_AAC:
|
||||||
|
case AFMT_MPC:
|
||||||
tracks[track_widx].id3.offset = offset;
|
tracks[track_widx].id3.offset = offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue