changeset 34374:09f2662d11cb

cdda: set position to an actual EOF position when we set EOF. This avoids some inconsistency like the stream indicating EOF but a read still returning more data.
author reimar
date Fri, 23 Dec 2011 21:52:04 +0000
parents 7a4dbec9415b
children 5b44af093b2a
files stream/stream_cdda.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_cdda.c	Fri Dec 23 21:50:32 2011 +0000
+++ b/stream/stream_cdda.c	Fri Dec 23 21:52:04 2011 +0000
@@ -182,6 +182,7 @@
   sec = s->pos/CD_FRAMESIZE_RAW;
   if (s->pos < 0 || sec > p->end_sector) {
     s->eof = 1;
+    p->sector = p->end_sector + 1;
     return 0;
   }
 
@@ -258,7 +259,7 @@
       int seek_sector;
       track += start_track;
       if (track > end_track) {
-        stream->eof = 1;
+        seek(stream, (p->end_sector + 1) * CD_FRAMESIZE_RAW);
         return STREAM_ERROR;
       }
       seek_sector = track <= 0 ? p->start_sector