From 88a2c17be2bf0c94e28aa2ea18aeeb5ed6973a79 Mon Sep 17 00:00:00 2001 From: ulion Date: Sat, 15 Dec 2007 15:38:38 +0000 Subject: Make the end_sector accessable (it should be). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25410 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_cdda.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index 2ce621edef..04076ca6fa 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -261,7 +261,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) { st->priv = priv; st->start_pos = priv->start_sector*CD_FRAMESIZE_RAW; - st->end_pos = priv->end_sector*CD_FRAMESIZE_RAW; + st->end_pos = (priv->end_sector + 1) * CD_FRAMESIZE_RAW; st->type = STREAMTYPE_CDDA; st->sector_size = CD_FRAMESIZE_RAW; @@ -289,6 +289,11 @@ static int fill_buffer(stream_t* s, char* buffer, int max_len) { int16_t * buf; int i; + if((p->sector < p->start_sector) || (p->sector > p->end_sector)) { + s->eof = 1; + return 0; + } + buf = paranoia_read(p->cdp,cdparanoia_callback); if (!buf) return 0; @@ -302,11 +307,6 @@ static int fill_buffer(stream_t* s, char* buffer, int max_len) { s->pos = p->sector*CD_FRAMESIZE_RAW; memcpy(buffer,buf,CD_FRAMESIZE_RAW); - if((p->sector < p->start_sector) || (p->sector >= p->end_sector)) { - s->eof = 1; - return 0; - } - for(i=0;icd->tracks;i++){ if(p->cd->disc_toc[i].dwStartSector==p->sector-1) { cd_track = cd_info_get_track(p->cd_info, i+1); @@ -333,7 +333,7 @@ static int seek(stream_t* s,off_t newpos) { s->pos = newpos; sec = s->pos/CD_FRAMESIZE_RAW; - if (s->pos < 0 || sec >= p->end_sector) { + if (s->pos < 0 || sec > p->end_sector) { s->eof = 1; return 0; } -- cgit v1.2.3