static int mp3_playback_thread(void *data){
int j;
unsigned long timeout;
static int mp3_playback_thread(void *data){
int j;
unsigned long timeout;
+ unsigned char empty = 0;
printk("started kthread\n");
daemonize("kmp3");
while(mp3_buffering_status != MP3_PLAY_FINISHED){
if((mp3_buffering_status == MP3_PLAYING) || (mp3_buffering_status == MP3_BUFFER_FINISHED)){
printk("started kthread\n");
daemonize("kmp3");
while(mp3_buffering_status != MP3_PLAY_FINISHED){
if((mp3_buffering_status == MP3_PLAYING) || (mp3_buffering_status == MP3_BUFFER_FINISHED)){
- while(VS1011_NEEDS_DATA){
+ while((VS1011_NEEDS_DATA) && (!empty)){
if(mp3_buffer_offset_read == MP3_BUFFER_SIZE){
mp3_buffer_offset_read = 0;
}
if(mp3_buffer_offset_read == MP3_BUFFER_SIZE){
mp3_buffer_offset_read = 0;
}
printk("mp3_drv.ko : finished playing\n");
mp3_buffering_status = MP3_PLAY_FINISHED;
} else {
printk("mp3_drv.ko : finished playing\n");
mp3_buffering_status = MP3_PLAY_FINISHED;
} else {
printk("mp3_drv.ko : buffer empty ?\n");
if(mp3_buffering_status != MP3_PLAY_FINISHED){
}
printk("mp3_drv.ko : buffer empty ?\n");
if(mp3_buffering_status != MP3_PLAY_FINISHED){
}
- timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout);
+ timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout);
}
complete_and_exit(&mp3_exit, 0);
}
}
complete_and_exit(&mp3_exit, 0);
}