mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
Make the end_sector accessable (it should be).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25410 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
f30650e3b5
commit
88a2c17be2
@ -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;i<p->cd->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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user