forked from len0rd/rockbox
Fixed: Crossfading, broken elapsed info with mp3 files, possible cpu
boost problem and track changing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7027 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2d79df5086
commit
d6e7942426
4 changed files with 21 additions and 15 deletions
|
@ -119,11 +119,11 @@ enum codec_status codec_start(struct codec_api* api)
|
||||||
first_frame = false;
|
first_frame = false;
|
||||||
file_end = 0;
|
file_end = 0;
|
||||||
OutputPtr = OutputBuffer;
|
OutputPtr = OutputBuffer;
|
||||||
frequency_divider = ci->id3->frequency / 100;
|
|
||||||
|
|
||||||
while (!*ci->taginfo_ready)
|
while (!*ci->taginfo_ready)
|
||||||
ci->yield();
|
ci->yield();
|
||||||
|
|
||||||
|
frequency_divider = ci->id3->frequency / 100;
|
||||||
ci->configure(DSP_SET_FREQUENCY, (int *)ci->id3->frequency);
|
ci->configure(DSP_SET_FREQUENCY, (int *)ci->id3->frequency);
|
||||||
|
|
||||||
ci->request_buffer(&size, ci->id3->first_frame_offset);
|
ci->request_buffer(&size, ci->id3->first_frame_offset);
|
||||||
|
|
|
@ -1236,16 +1236,19 @@ bool codec_request_next_track_callback(void)
|
||||||
|
|
||||||
/* Advance to next track. */
|
/* Advance to next track. */
|
||||||
if (ci.reload_codec && new_track > 0) {
|
if (ci.reload_codec && new_track > 0) {
|
||||||
/* Wait for new track data. */
|
|
||||||
while (track_ridx == track_widx && filling)
|
|
||||||
yield();
|
|
||||||
|
|
||||||
if (!playlist_check(1))
|
if (!playlist_check(1))
|
||||||
return false;
|
return false;
|
||||||
last_peek_offset--;
|
last_peek_offset--;
|
||||||
playlist_next(1);
|
playlist_next(1);
|
||||||
if (++track_ridx == MAX_TRACK)
|
if (++track_ridx == MAX_TRACK)
|
||||||
track_ridx = 0;
|
track_ridx = 0;
|
||||||
|
|
||||||
|
/* Wait for new track data (codectype 0 is invalid). When a correct
|
||||||
|
codectype is set, we can assume that the filesize is correct. */
|
||||||
|
while (tracks[track_ridx].id3.codectype == 0 && filling
|
||||||
|
&& !ci.stop_codec)
|
||||||
|
yield();
|
||||||
|
|
||||||
if (tracks[track_ridx].filesize == 0) {
|
if (tracks[track_ridx].filesize == 0) {
|
||||||
logf("Loading from disk...");
|
logf("Loading from disk...");
|
||||||
new_track = 0;
|
new_track = 0;
|
||||||
|
@ -1274,10 +1277,6 @@ bool codec_request_next_track_callback(void)
|
||||||
|
|
||||||
/* Codec requested track change (next track). */
|
/* Codec requested track change (next track). */
|
||||||
else {
|
else {
|
||||||
/* Wait for new track data. */
|
|
||||||
while (track_ridx == track_widx && filling)
|
|
||||||
yield();
|
|
||||||
|
|
||||||
if (!playlist_check(1))
|
if (!playlist_check(1))
|
||||||
return false;
|
return false;
|
||||||
last_peek_offset--;
|
last_peek_offset--;
|
||||||
|
@ -1285,7 +1284,13 @@ bool codec_request_next_track_callback(void)
|
||||||
if (++track_ridx >= MAX_TRACK)
|
if (++track_ridx >= MAX_TRACK)
|
||||||
track_ridx = 0;
|
track_ridx = 0;
|
||||||
|
|
||||||
if (track_ridx == track_widx && tracks[track_ridx].filerem == 0) {
|
/* Wait for new track data (codectype 0 is invalid). When a correct
|
||||||
|
codectype is set, we can assume that the filesize is correct. */
|
||||||
|
while (tracks[track_ridx].id3.codectype == 0 && filling
|
||||||
|
&& !ci.stop_codec)
|
||||||
|
yield();
|
||||||
|
|
||||||
|
if (tracks[track_ridx].filesize == 0) {
|
||||||
logf("No more tracks");
|
logf("No more tracks");
|
||||||
new_track = 0;
|
new_track = 0;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
/* Audio file types. */
|
/* Audio file types. */
|
||||||
/* NOTE: When adding new audio types, also add to codec_labels[] in id3.c */
|
/* NOTE: When adding new audio types, also add to codec_labels[] in id3.c */
|
||||||
enum {
|
enum {
|
||||||
AFMT_UNKNOWN = 0, /* Unknown file format */
|
AFMT_UNKNOWN = 1, /* Unknown file format */
|
||||||
|
|
||||||
#if CONFIG_HWCODEC==MASNONE
|
#if CONFIG_HWCODEC==MASNONE
|
||||||
AFMT_MPA_L1, /* MPEG Audio layer 1 */
|
AFMT_MPA_L1, /* MPEG Audio layer 1 */
|
||||||
|
|
|
@ -127,7 +127,7 @@ void pcm_boost(bool state)
|
||||||
{
|
{
|
||||||
static bool boost_state = false;
|
static bool boost_state = false;
|
||||||
|
|
||||||
if (crossfade_active || boost_mode)
|
if (crossfade_init || crossfade_active || boost_mode)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
if (state != boost_state) {
|
if (state != boost_state) {
|
||||||
|
@ -158,6 +158,7 @@ static void dma_stop(void)
|
||||||
next_start = NULL;
|
next_start = NULL;
|
||||||
next_size = 0;
|
next_size = 0;
|
||||||
crossfade_init = 0;
|
crossfade_init = 0;
|
||||||
|
crossfade_active = 0;
|
||||||
pcm_paused = false;
|
pcm_paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,13 +256,12 @@ void pcm_play_data(const unsigned char* start, int size,
|
||||||
|
|
||||||
void pcm_play_stop(void)
|
void pcm_play_stop(void)
|
||||||
{
|
{
|
||||||
crossfade_active = false;
|
|
||||||
pcm_set_boost_mode(false);
|
|
||||||
pcm_boost(false);
|
|
||||||
if (pcm_playing) {
|
if (pcm_playing) {
|
||||||
uda1380_mute(true);
|
uda1380_mute(true);
|
||||||
dma_stop();
|
dma_stop();
|
||||||
}
|
}
|
||||||
|
pcm_set_boost_mode(false);
|
||||||
|
pcm_boost(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcm_play_pause(bool play)
|
void pcm_play_pause(bool play)
|
||||||
|
@ -436,6 +436,7 @@ bool pcm_crossfade_init(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
logf("crossfading!");
|
logf("crossfading!");
|
||||||
|
pcm_boost(true);
|
||||||
crossfade_mode = CFM_CROSSFADE;
|
crossfade_mode = CFM_CROSSFADE;
|
||||||
crossfade_init = true;
|
crossfade_init = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue