mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 21:06:00 +00:00
CDDA seeking fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8525 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e4d8182636
commit
93bc457163
@ -204,14 +204,15 @@ void seek_cdda(stream_t* s) {
|
||||
int i;
|
||||
|
||||
sec = s->pos/CD_FRAMESIZE_RAW;
|
||||
//printf("pos: %d, sec: %d ## %d\n", s->pos, sec, s->pos/CD_FRAMESIZE_RAW);
|
||||
//printf("sector: %d\n", p->sector );
|
||||
//printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);
|
||||
//printf("sector: %d new: %d\n", p->sector, sec );
|
||||
|
||||
for(i=0;i<p->cd->tracks;i++){
|
||||
if( p->sector>p->cd->disc_toc[i].dwStartSector && p->sector<p->cd->disc_toc[i+1].dwStartSector ) {
|
||||
printf("trk #%d: %d .. %d\n",i,p->cd->disc_toc[i].dwStartSector,p->cd->disc_toc[i+1].dwStartSector);
|
||||
if( p->sector>=p->cd->disc_toc[i].dwStartSector && p->sector<p->cd->disc_toc[i+1].dwStartSector ) {
|
||||
current_track = i;
|
||||
}
|
||||
if( sec>p->cd->disc_toc[i].dwStartSector && sec<p->cd->disc_toc[i+1].dwStartSector ) {
|
||||
if( sec>=p->cd->disc_toc[i].dwStartSector && sec<p->cd->disc_toc[i+1].dwStartSector ) {
|
||||
seeked_track = i;
|
||||
}
|
||||
}
|
||||
@ -224,16 +225,17 @@ void seek_cdda(stream_t* s) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(sec < p->start_sector)
|
||||
sec = p->start_sector;
|
||||
else if(sec > p->end_sector)
|
||||
sec = p->end_sector;
|
||||
#endif
|
||||
|
||||
p->sector = sec;
|
||||
// s->pos = sec*CD_FRAMESIZE_RAW;
|
||||
|
||||
//printf("seek: %d, sec: %d\n", s->pos, sec);
|
||||
//printf("seek: %d, sec: %d\n", (int)s->pos, sec);
|
||||
paranoia_seek(p->cdp,sec,SEEK_SET);
|
||||
|
||||
}
|
||||
|
@ -87,5 +87,7 @@ void demux_rawaudio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
|
||||
|
||||
pos -= (pos % (sh_audio->channels * sh_audio->samplesize) );
|
||||
stream_seek(s,pos);
|
||||
sh_audio->delay=pos / (float)(sh_audio->wf->nAvgBytesPerSec);
|
||||
resync_audio_stream(sh_audio);
|
||||
// printf("demux_rawaudio: streamtell=%d\n",(int)stream_tell(demuxer->stream));
|
||||
}
|
||||
|
@ -130,6 +130,10 @@ off_t newpos=0;
|
||||
newpos=(pos/VCD_SECTOR_DATA)*VCD_SECTOR_DATA;break;
|
||||
case STREAMTYPE_DVD:
|
||||
newpos=pos/2048; newpos*=2048; break;
|
||||
#ifdef HAVE_CDDA
|
||||
case STREAMTYPE_CDDA:
|
||||
newpos=(pos/VCD_SECTOR_SIZE)*VCD_SECTOR_SIZE;break;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(verbose>=3){
|
||||
|
Loading…
Reference in New Issue
Block a user