Date: Fri, 7 Nov 1997 08:04:45 -0800 (PST) From: max@iclub.nsu.ru To: freebsd-gnats-submit@FreeBSD.ORG Subject: bin/4969: cdcontrol plays incorrect audio tracks in 'MSF relative to track' mode Message-ID: <199711071604.IAA06726@hub.freebsd.org> Resent-Message-ID: <199711071610.IAA07053@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4969 >Category: bin >Synopsis: cdcontrol plays incorrect audio tracks in 'MSF relative to track' mode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 7 08:10:01 PST 1997 >Last-Modified: >Originator: Max Khon >Organization: MCA Software Group >Release: 2.2.5-STABLE >Environment: FreeBSD iclub.nsu.ru 2.2.5-STABLE FreeBSD 2.2.5-STABLE #0: Sat Nov 1 15:42:33 NS 1997 max@iclub.nsu.ru:/usr/src/sys/compile/iclub i386 >Description: cdcontrol play track (n+1) instead of n when using 'MSF relative to track' mode >How-To-Repeat: husky:~$cdcontrol -f wcd0 Compact Disc Control utility, version 2.0 Type `?' for command list cdcontrol> play 5 0:0 (actually track 6 is played) >Fix: apply the following patch === cut here === --- cdcontrol.c.orig Fri Nov 7 19:32:56 1997 +++ cdcontrol.c Fri Nov 7 21:44:58 1997 @@ -16,6 +16,11 @@ * 11-Oct-1995: Serge V.Vakulenko <vak@cronyx.ru> * New eject algorithm. * Some code style reformatting. + * + * 07-Nov-1997: Max Khon <max@iclub.nsu.ru> + * 'play MSF relative to track' some fixes + * (cdcontrol played incorrect track). + * */ #ifndef lint @@ -425,7 +430,7 @@ /* * Play MSF m1:s1 [ .f1 ] [ m2:s2 [ .f2 ] ] * - * Will now also undestand timed addresses relative + * Will now also understand timed addresses relative * to the beginning of a track in the form... * * tr1 m1:s1[.f1] [[tr2] [m2:s2[.f2]]] @@ -499,10 +504,9 @@ goto Try_Absolute_Timed_Addresses; Play_Relative_Addresses: - if (! tr1) - tr1 = 1; - else if (tr1 > n) - tr1 = n; + if (tr1 == 0 || tr1 > n) + goto Clean_up; + tr1--; if (msf) { tm = toc_buffer[tr1].addr.msf.minute; @@ -511,16 +515,6 @@ } else lba2msf(ntohl(toc_buffer[tr1].addr.lba), &tm, &ts, &tf); - if ((m1 > tm) - || ((m1 == tm) - && ((s1 > ts) - || ((s1 == ts) - && (f1 > tf))))) { - printf ("Track %d is not that long.\n", tr1); - return (0); - } - - tr1--; f1 += tf; if (f1 >= 75) { @@ -536,42 +530,16 @@ m1 += tm; - if (! tr2) { - if (m2 || s2 || f2) { - tr2 = tr1; - f2 += f1; - if (f2 >= 75) { - s2 += f2 / 75; - f2 %= 75; - } - - s2 += s1; - if (s2 > 60) { - m2 += s2 / 60; - s2 %= 60; - } - - m2 += m1; - } else { - tr2 = n; - if (msf) { - m2 = toc_buffer[n].addr.msf.minute; - s2 = toc_buffer[n].addr.msf.second; - f2 = toc_buffer[n].addr.msf.frame; - } else { - lba2msf(ntohl(toc_buffer[n].addr.lba), - &tm, &ts, &tf); - m2 = tm; - s2 = ts; - f2 = tf; - } - } - } else if (tr2 > n) { - tr2 = n; - m2 = s2 = f2 = 0; + if (tr2 == 0 && (m2 || s2 || f2)) { + tm = m1; + ts = s1; + tf = f1; } else { - if (m2 || s2 || f2) + if (tr2 == 0 || tr2 > n) + tr2 = n; + else tr2--; + if (msf) { tm = toc_buffer[tr2].addr.msf.minute; ts = toc_buffer[tr2].addr.msf.second; @@ -579,6 +547,13 @@ } else lba2msf(ntohl(toc_buffer[tr2].addr.lba), &tm, &ts, &tf); + } + + if (tr2 == n) { + m2 = tm; + s2 = ts; + f2 = tf; + } else { f2 += tf; if (f2 >= 75) { s2 += f2 / 75; @@ -594,22 +569,6 @@ m2 += tm; } - if (msf) { - tm = toc_buffer[n].addr.msf.minute; - ts = toc_buffer[n].addr.msf.second; - tf = toc_buffer[n].addr.msf.frame; - } else - lba2msf(ntohl(toc_buffer[n].addr.lba), - &tm, &ts, &tf); - if ((tr2 < n) - && ((m2 > tm) - || ((m2 == tm) - && ((s2 > ts) - || ((s2 == ts) - && (f2 > tf)))))) { - printf ("The playing time of the disc is not that long.\n"); - return (0); - } return (play_msf (m1, s1, f1, m2, s2, f2)); Try_Absolute_Timed_Addresses: === cut here === the patch does not resolve all the problems, because args parsing in 'play MSF relative to track' is broken >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711071604.IAA06726>