mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-24 20:20:18 +08:00
fix cdda://n syntax: do not hang when n > nr_tracks and play only track n,
not all after (unfortunately, cdda://n- does not work, use e.g. cdda://n-99999). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16927 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
+5
-2
@@ -97,6 +97,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
|
||||
cdda_priv* priv;
|
||||
cd_info_t *cd_info,*cddb_info = NULL;
|
||||
unsigned int audiolen=0;
|
||||
int last_track;
|
||||
int i;
|
||||
char *xmcd_file = NULL;
|
||||
|
||||
@@ -185,14 +186,16 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) {
|
||||
if(p->speed)
|
||||
cdda_speed_set(cdd,p->speed);
|
||||
|
||||
last_track = cdda_tracks(cdd);
|
||||
if (p->span.start > last_track) p->span.start = last_track;
|
||||
if (p->span.end < p->span.start) p->span.end = p->span.start;
|
||||
if (p->span.end > last_track) p->span.end = last_track;
|
||||
if(p->span.start)
|
||||
priv->start_sector = cdda_track_firstsector(cdd,p->span.start);
|
||||
else
|
||||
priv->start_sector = cdda_disc_firstsector(cdd);
|
||||
|
||||
if(p->span.end) {
|
||||
int last = cdda_tracks(cdd);
|
||||
if(p->span.end > last) p->span.end = last;
|
||||
priv->end_sector = cdda_track_lastsector(cdd,p->span.end);
|
||||
} else
|
||||
priv->end_sector = cdda_disc_lastsector(cdd);
|
||||
|
||||
Reference in New Issue
Block a user