mirror of https://github.com/hak5/openwrt-owl.git
fix a possible dead lock in the fonera-mp3 driver, that can happen, when the buffer runs dry
SVN-Revision: 8753owl
parent
2ef23a0fd9
commit
6ce13a764f
|
@ -101,11 +101,12 @@ static DECLARE_COMPLETION(mp3_exit);
|
||||||
static int mp3_playback_thread(void *data){
|
static int mp3_playback_thread(void *data){
|
||||||
int j;
|
int j;
|
||||||
unsigned long timeout;
|
unsigned long timeout;
|
||||||
|
unsigned char empty = 0;
|
||||||
printk("started kthread\n");
|
printk("started kthread\n");
|
||||||
daemonize("kmp3");
|
daemonize("kmp3");
|
||||||
while(mp3_buffering_status != MP3_PLAY_FINISHED){
|
while(mp3_buffering_status != MP3_PLAY_FINISHED){
|
||||||
if((mp3_buffering_status == MP3_PLAYING) || (mp3_buffering_status == MP3_BUFFER_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){
|
if(mp3_buffer_offset_read == MP3_BUFFER_SIZE){
|
||||||
mp3_buffer_offset_read = 0;
|
mp3_buffer_offset_read = 0;
|
||||||
}
|
}
|
||||||
|
@ -115,6 +116,7 @@ static int mp3_playback_thread(void *data){
|
||||||
printk("mp3_drv.ko : finished playing\n");
|
printk("mp3_drv.ko : finished playing\n");
|
||||||
mp3_buffering_status = MP3_PLAY_FINISHED;
|
mp3_buffering_status = MP3_PLAY_FINISHED;
|
||||||
} else {
|
} else {
|
||||||
|
empty = 1;
|
||||||
printk("mp3_drv.ko : buffer empty ?\n");
|
printk("mp3_drv.ko : buffer empty ?\n");
|
||||||
if(mp3_buffering_status != MP3_PLAY_FINISHED){
|
if(mp3_buffering_status != MP3_PLAY_FINISHED){
|
||||||
}
|
}
|
||||||
|
@ -128,6 +130,7 @@ static int mp3_playback_thread(void *data){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
empty = 0;
|
||||||
timeout = 1;
|
timeout = 1;
|
||||||
timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout);
|
timeout = wait_event_interruptible_timeout(wq, (timeout==0), timeout);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue