Add and improve logfing, fix a possible cause of problems due to abuse of read_next_metadata

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9628 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2006-04-11 23:08:21 +00:00
parent d6b370be02
commit af09d22125

View file

@ -1085,7 +1085,7 @@ static void audio_read_file(void)
} }
if (tracks[track_widx].filerem == 0) { if (tracks[track_widx].filerem == 0) {
logf("Finished buf."); logf("Finished buf:%dB", tracks[track_widx].filesize);
strip_id3v1_tag(); strip_id3v1_tag();
close(current_fd); close(current_fd);
current_fd = -1; current_fd = -1;
@ -1097,7 +1097,10 @@ static void audio_read_file(void)
* of data, stop filling after this track */ * of data, stop filling after this track */
if (filling_short && filebufused > conf_watermark * 2) if (filling_short && filebufused > conf_watermark * 2)
fill_bytesleft = 0; fill_bytesleft = 0;
} else { logf("Partially buf:%d", tracks[track_widx].available); } } else {
logf("Partially buf:%dB",
tracks[track_widx].filesize - tracks[track_widx].filerem);
}
} }
static void codec_discard_codec_callback(void) static void codec_discard_codec_callback(void)
@ -1430,6 +1433,7 @@ static bool audio_load_track(int offset, bool start_play)
if (start_play) if (start_play)
codec_track_changed(); codec_track_changed();
logf("arf:%s", trackname);
audio_read_file(); audio_read_file();
return true; return true;
@ -1599,14 +1603,11 @@ static void audio_fill_file_buffer(
else if (!audio_load_track(offset, start_play)) else if (!audio_load_track(offset, start_play))
fill_bytesleft = 0; fill_bytesleft = 0;
/* Read next unbuffered track's metadata as soon as playback begins */
if (pcm_is_playing() || fill_bytesleft == 0)
{
read_next_metadata();
/* If we're done buffering */ /* If we're done buffering */
if (fill_bytesleft == 0) if (fill_bytesleft == 0)
{ {
read_next_metadata();
generate_postbuffer_events(); generate_postbuffer_events();
filling = false; filling = false;
filling_short = false; filling_short = false;
@ -1617,7 +1618,6 @@ static void audio_fill_file_buffer(
ata_sleep(); ata_sleep();
#endif #endif
} }
}
} }
static void track_skip_done(void) static void track_skip_done(void)