diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-06 14:17:51 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-06 14:17:51 +0000 |
commit | ee37c78b40ebc29ce5f493667cb229323b5c19fe (patch) | |
tree | 685d8ce22f75851f7dc2e28f32a07658036f3145 /libmpdemux | |
parent | fb99b3a5c49d79c18157954e4d8376010f325b5f (diff) | |
download | mpv-ee37c78b40ebc29ce5f493667cb229323b5c19fe.tar.bz2 mpv-ee37c78b40ebc29ce5f493667cb229323b5c19fe.tar.xz |
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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/cdda.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libmpdemux/cdda.c b/libmpdemux/cdda.c index f6b098a11f..7307bbe76d 100644 --- a/libmpdemux/cdda.c +++ b/libmpdemux/cdda.c @@ -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); |