From 00f27965e5645de963bb57fd84e2acffd3320544 Mon Sep 17 00:00:00 2001 From: ulion Date: Fri, 14 Dec 2007 08:26:06 +0000 Subject: Fix stream cdda seeks to CD's end and hangs forever bug. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25390 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_cdda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index 41319c6c59..cf575d35a4 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -331,12 +331,12 @@ static int seek(stream_t* s,off_t newpos) { int i; s->pos = newpos; - if(s->pos < 0) { + sec = s->pos/CD_FRAMESIZE_RAW; + if (s->pos < 0 || sec >= p->end_sector) { s->eof = 1; return 0; } - sec = s->pos/CD_FRAMESIZE_RAW; //printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW); //printf("sector: %d new: %d\n", p->sector, sec ); -- cgit v1.2.3