Index: firmware/mpeg.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/mpeg.c,v
retrieving revision 1.203
diff -u -r1.203 mpeg.c
--- firmware/mpeg.c	22 Feb 2003 01:40:57 -0000	1.203
+++ firmware/mpeg.c	26 Feb 2003 00:12:36 -0000
@@ -1745,22 +1745,27 @@
                     {
                         if(len < 0)
                         {
+                            /* Read error. Assume due to skipping - try again */
                             DEBUGF("MPEG read error\n");
-                        }
-                        
-                        close(mpeg_file);
-                        mpeg_file = -1;
-                    
-                        if(new_file(1) < 0)
-                        {
-                            /* No more data to play */
-                            DEBUGF("No more files to play\n");
-                            filling = false;
+                            queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
                         }
                         else
                         {
-                            /* Tell ourselves that we want more data */
-                            queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
+                            /* End of file. Skip to next file */
+                            close(mpeg_file);
+                            mpeg_file = -1;
+                    
+                            if(new_file(1) < 0)
+                            {
+                                /* No more data to play */
+                                DEBUGF("No more files to play\n");
+                                filling = false;
+                            }
+                            else
+                            {
+                                /* Tell ourselves that we want more data */
+                                queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
+                            }
                         }
                     }
                 }


