aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2001-07-17 03:46:26 +0800
committersobomax <sobomax@FreeBSD.org>2001-07-17 03:46:26 +0800
commit75514b814b55d701ba631d32a7c6ad143d2c1665 (patch)
treeaeaf2d05b4e244d9c505119f431ee033df7382fa /audio
parent075aae5f7c19c8804e0c3fd22420bc9d9e1cd027 (diff)
downloadfreebsd-ports-gnome-75514b814b55d701ba631d32a7c6ad143d2c1665.tar.gz
freebsd-ports-gnome-75514b814b55d701ba631d32a7c6ad143d2c1665.tar.zst
freebsd-ports-gnome-75514b814b55d701ba631d32a7c6ad143d2c1665.zip
Update to 1.2.3.
Diffstat (limited to 'audio')
-rw-r--r--audio/gnome-media/Makefile2
-rw-r--r--audio/gnome-media/distinfo2
-rw-r--r--audio/gnome-media/files/patch-ad39
-rw-r--r--audio/gnome-media/files/patch-ae796
-rw-r--r--audio/gnome-media/files/patch-gmix::gmix.h22
-rw-r--r--audio/gnome-media/files/patch-tcd::cddb.c65
-rw-r--r--audio/gnome-media/files/patch-tcd::gtcd.c100
-rw-r--r--audio/gnome-media/files/patch-tcd::gtracked.c16
-rw-r--r--audio/gnome-media/files/patch-tcd::linux-cdrom.c667
-rw-r--r--audio/gnome-media/files/patch-tcd::linux-cdrom.h73
-rw-r--r--audio/gnome-media/files/patch-tcd::tcd.c79
-rw-r--r--audio/gnome-media/pkg-plist59
-rw-r--r--audio/gnomemedia/Makefile2
-rw-r--r--audio/gnomemedia/distinfo2
-rw-r--r--audio/gnomemedia/files/patch-ad39
-rw-r--r--audio/gnomemedia/files/patch-ae796
-rw-r--r--audio/gnomemedia/files/patch-gmix::gmix.h22
-rw-r--r--audio/gnomemedia/files/patch-tcd::cddb.c65
-rw-r--r--audio/gnomemedia/files/patch-tcd::gtcd.c100
-rw-r--r--audio/gnomemedia/files/patch-tcd::gtracked.c16
-rw-r--r--audio/gnomemedia/files/patch-tcd::linux-cdrom.c667
-rw-r--r--audio/gnomemedia/files/patch-tcd::linux-cdrom.h73
-rw-r--r--audio/gnomemedia/files/patch-tcd::tcd.c79
-rw-r--r--audio/gnomemedia/pkg-plist59
-rw-r--r--audio/gnomemedia2/Makefile2
-rw-r--r--audio/gnomemedia2/distinfo2
-rw-r--r--audio/gnomemedia2/files/patch-ad39
-rw-r--r--audio/gnomemedia2/files/patch-ae796
-rw-r--r--audio/gnomemedia2/files/patch-gmix::gmix.h22
-rw-r--r--audio/gnomemedia2/files/patch-tcd::cddb.c65
-rw-r--r--audio/gnomemedia2/files/patch-tcd::gtcd.c100
-rw-r--r--audio/gnomemedia2/files/patch-tcd::gtracked.c16
-rw-r--r--audio/gnomemedia2/files/patch-tcd::linux-cdrom.c667
-rw-r--r--audio/gnomemedia2/files/patch-tcd::linux-cdrom.h73
-rw-r--r--audio/gnomemedia2/files/patch-tcd::tcd.c79
-rw-r--r--audio/gnomemedia2/pkg-plist59
36 files changed, 3327 insertions, 2433 deletions
diff --git a/audio/gnome-media/Makefile b/audio/gnome-media/Makefile
index 42d4f7abdbc9..cbb0f9b3a05d 100644
--- a/audio/gnome-media/Makefile
+++ b/audio/gnome-media/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= gnomemedia
-PORTVERSION= 1.2.0
+PORTVERSION= 1.2.3
CATEGORIES= audio gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= stable/sources/gnome-media
diff --git a/audio/gnome-media/distinfo b/audio/gnome-media/distinfo
index 311191fc2cc0..ece2b633d459 100644
--- a/audio/gnome-media/distinfo
+++ b/audio/gnome-media/distinfo
@@ -1 +1 @@
-MD5 (gnome-media-1.2.0.tar.gz) = c7cda6054b47f71aa46aaabe9db6fb4c
+MD5 (gnome-media-1.2.3.tar.gz) = bcd99b4fe81141d36bbd40d74a9b448f
diff --git a/audio/gnome-media/files/patch-ad b/audio/gnome-media/files/patch-ad
index 8c2d1acfb01f..8f4a302b3334 100644
--- a/audio/gnome-media/files/patch-ad
+++ b/audio/gnome-media/files/patch-ad
@@ -1,24 +1,9 @@
---- gmix/gmix.c.orig Sun Feb 21 12:10:17 1999
-+++ gmix/gmix.c Mon Mar 8 20:41:05 1999
-@@ -94,6 +94,17 @@
- /*
- * All, that is known about a mixer-device
- */
-+
-+#if !defined(OPEN_SOUND_SYSTEM)
-+typedef struct mixer_info
-+{
-+ char id[16];
-+ char name[32];
-+ int modify_counter;
-+ int fillers[10];
-+} mixer_info;
-+#endif
-+
- typedef struct device_info {
- int fd;
- mixer_info info;
-@@ -272,11 +283,7 @@
+
+$FreeBSD$
+
+--- gmix/gmix.c.orig Mon Jun 11 20:50:47 2001
++++ gmix/gmix.c Fri Jul 13 12:45:08 2001
+@@ -499,11 +499,7 @@
/*
* open the mixer-device
*/
@@ -30,9 +15,9 @@
+ sprintf(device_name, "/dev/mixer%i", num);
new_device->fd=open(device_name, O_RDWR, 0);
if (new_device->fd<0) {
- free(new_device);
-@@ -291,6 +298,8 @@
- fprintf(stderr, "Warning: This version of gmix was compiled with a different version of\nsoundcard.h.\n");
+ g_free(new_device);
+@@ -535,6 +531,8 @@
+ }
}
#endif
+
@@ -40,7 +25,7 @@
/*
* mixer-name
*/
-@@ -301,6 +310,11 @@
+@@ -545,6 +543,11 @@
}
if(!isalpha(new_device->info.name[0]))
g_snprintf(new_device->info.name, 31, "Card %d", num+1);
@@ -52,7 +37,7 @@
/*
* several bitmasks describing the mixer
*/
-@@ -386,15 +400,16 @@
+@@ -677,15 +680,16 @@
{
int cnt;
device_info *new_device;
@@ -71,4 +56,4 @@
+ || new_device);
}
- void free_one_device(gpointer a, gpointer b)
+ #ifdef ALSA
diff --git a/audio/gnome-media/files/patch-ae b/audio/gnome-media/files/patch-ae
index b2878eb5521b..53c2143d301b 100644
--- a/audio/gnome-media/files/patch-ae
+++ b/audio/gnome-media/files/patch-ae
@@ -1,789 +1,23 @@
---- tcd/callbacks.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/callbacks.c Tue May 30 15:17:17 2000
-@@ -12,3 +12,3 @@
- {
+
+$FreeBSD$
+
+--- tcd/callbacks.c 2001/07/13 07:48:12 1.1
++++ tcd/callbacks.c 2001/07/13 07:50:36
+@@ -13,7 +13,7 @@
+ {
+ if(!cd.isplayable)
+ return;
- if(cd.sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
+ if(SC_AUDIOSTATUS(cd.sc)==CDROM_AUDIO_PAUSED)
tcd_pausecd(&cd);
-@@ -44,3 +44,3 @@
+ else
+ tcd_playtracks(&cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -45,7 +45,7 @@
+ cd.play_method = NORMAL;
+ cd.repeat_track = -1;
/* SDH: Make sure play/pause state change is noticed */
- cd.sc.cdsc_audiostatus = -1;
+ SC_AUDIOSTATUS(cd.sc) = -1;
if(cd.isplayable)
---- tcd/cddb.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/cddb.c Tue May 30 15:17:17 2000
-@@ -201,7 +201,7 @@
-
-- min = cd->trk[trk].toc.cdte_addr.msf.minute;
-- sec = cd->trk[trk].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[trk]);
-+ sec = TOC_SECOND(cd->trk[trk]);
-
- n = (min*60)+sec;
-- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
-+ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
- }
-@@ -209,4 +209,4 @@
- fprintf( fp, "#\n# Disc length: %i seconds\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
-
-@@ -247,6 +247,6 @@
-
-- min = cd->trk[i].toc.cdte_addr.msf.minute;
-- sec = cd->trk[i].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[i]);
-+ sec = TOC_SECOND(cd->trk[i]);
-
-- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
-+ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
-
-@@ -259,4 +259,4 @@
- l=sprintf( tmp, "%i\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
- if(blen>l)
-@@ -300,5 +300,5 @@
- {
-- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
-- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
-- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
-+ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
-+ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
-+ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
- }
---- tcd/gtcd.c.orig Sun May 21 15:13:04 2000
-+++ tcd/gtcd.c Tue May 30 15:17:17 2000
-@@ -157,3 +157,7 @@
- cd.time_lock = TRUE;
-+#ifdef TCD_BSD
-+ ioctl(cd.cd_dev, CDIOCPAUSE);
-+#else
- ioctl(cd.cd_dev, CDROMPAUSE);
-+#endif
-
-@@ -421,4 +425,4 @@
- cur = cd.cur_pos_abs;
-- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
-- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
-+ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
-+ +TOC_SECOND(cd.trk[cd.last_t+1]));
- pos = end-cur;
-@@ -524,3 +528,3 @@
- {
-- switch( cd.sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd.sc) )
- {
-@@ -620,4 +624,4 @@
- /* see if we need to repeat */
-- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -638,3 +642,3 @@
- {
-- if(old_status != cd.sc.cdsc_audiostatus)
-+ if(old_status != SC_AUDIOSTATUS(cd.sc))
- {
-@@ -645,3 +649,3 @@
-
-- old_status = cd.sc.cdsc_audiostatus;
-+ old_status = SC_AUDIOSTATUS(cd.sc);
- g_snprintf(tmp, 255, "tcd/%s.xpm",
---- tcd/gtracked.c.orig Sun May 21 15:13:05 2000
-+++ tcd/gtracked.c Tue May 30 15:17:17 2000
-@@ -211,4 +211,4 @@
- g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
-+ TOC_MINUTE(cd.trk[cd.last_t+1]),
-+ TOC_SECOND(cd.trk[cd.last_t+1]));
-
---- tcd/linux-cdrom.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.c Tue May 30 15:29:32 2000
-@@ -73,3 +73,3 @@
-
--#if defined(TCD_CHANGER_ENABLED)
-+#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
- cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
-@@ -116,4 +116,7 @@
- {
-- int tmp,i;
-+ int i;
- int delsecs;
-+#ifdef TCD_BSD
-+ struct ioc_read_toc_single_entry tocentry;
-+#endif
-
-@@ -127,3 +130,7 @@
- /* read the TOC header */
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
-+#else
- if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
-+#endif
- {
-@@ -134,2 +141,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -138,11 +148,25 @@
- /* grab first & last tracks */
-+#ifdef TCD_BSD
-+ cd->first_t = cd->tochdr.starting_track;
-+ cd->last_t = cd->tochdr.ending_track;
-+#else
- cd->first_t = cd->tochdr.cdth_trk0;
- cd->last_t = cd->tochdr.cdth_trk1;
-+#endif
-
- /* read the leadout track */
-+#ifdef TCD_BSD
-+ tocentry.track = 0xaa; /* Magic last track */
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
- cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
-+#endif
-
- /* read the leadout toc */
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
-+#endif
- {
-@@ -154,4 +178,15 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-- }
-+ }
-+
-+#ifdef TCD_BSD
-+ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
-+#endif
-+ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
-+ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
-
-@@ -160,6 +195,15 @@
- {
-+#ifdef TCD_BSD
-+ tocentry.track = i;
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(i)].toc.cdte_track = i;
- cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
-+#endif
-
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
-+#endif
- {
-@@ -170,2 +214,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -173,7 +220,12 @@
-
-+#ifdef TCD_BSD
-+ cd->trk[C(i)].toc = tocentry.entry;
-+ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
-+#else
- cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
-- cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
-- cd->trk[C(i)].toc.cdte_addr.msf.second;
-+#endif
-+ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
-+ TOC_SECOND(cd->trk[C(i)]);
- cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
-- cd->trk[C(i)].toc.cdte_addr.msf.frame;
-+ TOC_FRAME(cd->trk[C(i)]);
- }
-@@ -184,6 +236,3 @@
- /* Taken from cdtool...Thanks Thomas I.! */
-- delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
-- + cd->trk[C(i+1)].toc.cdte_addr.msf.second
-- - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
-- - cd->trk[C(i)].toc.cdte_addr.msf.second;
-+ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
-
-@@ -206,3 +255,3 @@
- debug("cdrom.c: tcd_readtoc exiting normally\n" );
-- return tmp;
-+ return 0;
- }
-@@ -216,5 +265,4 @@
- /* calculate various timing values */
-- cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
-- cd->sc.cdsc_absaddr.msf.second;
-- cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
-+ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
-+ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
-
-@@ -237,4 +285,6 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
- #endif
-+#endif
- }
-@@ -284,4 +334,16 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_read_subchannel subch;
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ subch.address_format = CD_MSF_FORMAT;
-+ subch.data_format = CD_CURRENT_POSITION;
-+ subch.data_len = sizeof(cd->sc);
-+ subch.track = 0;
-+ subch.data = &(cd->sc);
-+#else
- cd->sc.cdsc_format = CDROM_MSF;
-+#endif
-
-@@ -289,3 +351,7 @@
- {
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch)) == -1)
-+#else
- if(ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc))
-+#endif
- {
-@@ -295,8 +361,21 @@
- cd->cur_t = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return;
- }
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
-- cd->cur_t = cd->sc.cdsc_trk;
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-+ cd->cur_t = SC_TRACK(cd->sc);
-+ }
- else
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- cd->cur_t = 0;
-+ }
- tcd_recalculate(cd);
-@@ -307,8 +386,21 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+#else
- struct cdrom_volctrl vol;
-+#endif
-
-+#ifdef TCD_BSD
-+ vol.vol[0] = volume;
-+ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
-+#else
- vol.channel0 = volume;
- vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
--
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSETVOL, &vol) < 0)
-+#else
- if(ioctl(cd->cd_dev, CDROMVOLCTRL, &vol) < 0)
-+#endif
- return FALSE;
-@@ -320,2 +412,10 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+
-+ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
-+ return -1;
-+
-+ return vol.vol[0];
-+#else
- #ifdef CDROMVOLREAD
-@@ -330,2 +430,3 @@
- #endif
-+#endif
- }
-@@ -334,4 +435,30 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#define MSF_START_MIN (msf.start_m)
-+#define MSF_START_SEC (msf.start_s)
-+#define MSF_START_FRM (msf.start_f)
-+#define MSF_END_MIN (msf.end_m)
-+#define MSF_END_SEC (msf.end_s)
-+#define MSF_END_FRM (msf.end_f)
-+ struct ioc_play_track trkind;
-+#define TI_START_TRK (trkind.start_track)
-+#define TI_START_IND (trkind.start_index)
-+#define TI_END_TRK (trkind.end_track)
-+#define TI_END_IND (trkind.end_index)
-+#else
- struct cdrom_msf msf;
-+#define MSF_START_MIN (msf.cdmsf_min0)
-+#define MSF_START_SEC (msf.cdmsf_sec0)
-+#define MSF_START_FRM (msf.cdmsf_frame0)
-+#define MSF_END_MIN (msf.cdmsf_min1)
-+#define MSF_END_SEC (msf.cdmsf_sec1)
-+#define MSF_END_FRM (msf.cdmsf_frame0)
- struct cdrom_ti trkind;
-+#define TI_START_TRK (trkind.cdti_trk0)
-+#define TI_START_IND (trkind.cdti_ind0)
-+#define TI_END_TRK (trkind.cdti_trk1)
-+#define TI_END_IND (trkind.cdti_ind1)
-+#endif
-+
- int tmp;
-@@ -344,3 +471,3 @@
- {
-- /* try and inject cd */
-+ /* try and eject cd */
- tcd_ejectcd(cd);
-@@ -354,2 +481,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl(cd->cd_dev, CDIOCCLOSE);
-+#else
- #if defined(CDROMCLOSETRAY)
-@@ -358,9 +488,15 @@
- #endif
--
-+#endif
-+
-+ /* bad hack. most data tracks are the first track... */
-+#ifdef TCD_BSD
-+ if(cd->trk[start_t].toc.control == 0x04)
-+#else
- if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
-- start_t++; /* bad hack. most data tracks are the first track... */
-+#endif
-+ start_t++;
-
-- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
-+ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
-+ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
-+ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
-
-@@ -368,5 +504,5 @@
- {
-- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
-- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
-- msf.cdmsf_frame1=0;
-+ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
-+ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
-+ MSF_END_FRM = 0;
- }
-@@ -374,20 +510,20 @@
- {
-- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame - 1;
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if(MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
-@@ -395,6 +531,11 @@
- }
-- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
-- msf.cdmsf_sec1 %= 60;
-+ MSF_END_MIN += (MSF_END_SEC / 60);
-+ MSF_END_SEC %= 60;
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
-+#endif
- {
-@@ -403,8 +544,12 @@
- /* Try alternate method of playing */
-- trkind.cdti_trk0 = start_t; /* start track */
-- trkind.cdti_ind0 = 0; /* start index */
-- trkind.cdti_trk1 = end_t; /* end track */
-- trkind.cdti_ind1 = 0; /* end index */
-+ TI_START_TRK = start_t; /* start track */
-+ TI_START_IND = 0; /* start index */
-+ TI_END_TRK = end_t; /* end track */
-+ TI_END_IND = 0; /* end index */
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
-+#endif
- {
-@@ -413,2 +558,5 @@
- debug("cdrom.c: tcd_playtracks error. CDROMPLAYTRKIND ioctl error.\n");
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return -1;
-@@ -422,21 +570,10 @@
-
--static int msf_2_frame( cd_min_sec_frame *msf )
--{
-- return( ( msf->minute * CD_SECS + msf->second )
-- * CD_FRAMES + msf->frame );
--}
--
--static void frame_2_msf( int frame, cd_min_sec_frame *msf )
--{
-- msf->frame = frame % CD_FRAMES;
-- frame /= CD_FRAMES;
-- msf->second = frame % CD_SECS;
-- msf->minute = frame / CD_SECS;
--}
--
- int tcd_play_seconds( cd_struct *cd, long int offset )
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#else
- struct cdrom_msf msf;
-- cd_min_sec_frame msf0;
-- int cur_frame, start_frame, end_frame;
-+#endif
-+ int tmp;
-
-@@ -447,41 +584,42 @@
-
-- /* converting msf to frames makes life much easier */
-- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
-- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
-- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
--
-- /* keep the cur_frame within the boundaries of the first and last track */
-- if ( cur_frame < start_frame ) {
-- cur_frame = start_frame;
-- } else if ( cur_frame > end_frame ) {
-- cur_frame = end_frame;
-- }
--
-- /* convert frames back to msf */
-- frame_2_msf( cur_frame, &msf0 );
-- msf.cdmsf_min0 = msf0.minute;
-- msf.cdmsf_sec0 = msf0.second;
-- msf.cdmsf_frame0 = msf0.frame;
-- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame - 1;
-+ /* got subchannel? */
-+ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
-+ MSF_START_MIN = SC_MINUTE(cd->sc);
-+ MSF_START_FRM = SC_FRAME(cd->sc);
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if((MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
- #endif
-+
-+ if(MSF_START_SEC > 60 && (offset<0))
-+ {
-+ MSF_START_SEC = 60-abs(offset);
-+ MSF_START_MIN--;
-+ }
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT );
-+#endif
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYMSF, &msf))
-+#endif
- {
-@@ -491,2 +629,5 @@
- debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW );
-+#endif
- return(-1);
-@@ -507,3 +648,11 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(!ioctl(cd->cd_dev, CDIOCEJECT))
-+#else
- if(!ioctl(cd->cd_dev, CDROMEJECT))
-+#endif
- {
-@@ -515,2 +664,5 @@
- {
-+#ifdef TCD_BSD
-+ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
-+#else
- #ifdef CDROMCLOSETRAY
-@@ -518,2 +670,7 @@
- #endif
-+#endif
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-
-@@ -527,2 +684,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -544,7 +704,15 @@
- /* SDH: Makes things cleaner on eject */
-- if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSTOP))
-+#else
- if(ioctl(cd->cd_dev, CDROMSTOP))
-+#endif
- {
-@@ -566,5 +734,9 @@
-
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
-- {
-+ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
-+ {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCRESUME)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMRESUME)))
-+#endif
- {
-@@ -572,4 +744,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -578,3 +756,7 @@
- {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCPAUSE)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMPAUSE)))
-+#endif
- {
-@@ -582,4 +764,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -591,2 +779,3 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- int tmp;
-@@ -599,6 +788,6 @@
- return tmp;
--#else
-+#endif
-+#endif
- debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
- return 0;
--#endif
- }
---- tcd/linux-cdrom.h.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.h Tue May 30 15:34:32 2000
-@@ -29,4 +29,16 @@
- #include <glib.h>
--#if !defined(linux) && !defined(sun) && !defined(__sun__)
--# error TCD only builds on linux and Solaris/SunOs
-+#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
-+# error TCD only builds on Linux, Solaris, SunOS, and FreeBSD
-+#endif
-+
-+#ifdef __FreeBSD__
-+#define TCD_BSD
-+#include <sys/cdio.h>
-+#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
-+#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
-+#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
-+#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
-+#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
-+#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
-+#define CDROM
- #endif
-@@ -128,3 +140,13 @@
- char extd[EXT_DATA_LEN+1]; /* extra information for this track */
-+#ifdef TCD_BSD
-+ struct cd_toc_entry toc;
-+#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
-+#else
- struct cdrom_tocentry toc;
-+#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
-+#endif
- int titled;
-@@ -154,2 +176,14 @@
-
-+#ifdef TCD_BSD
-+ /* See /usr/include/sys/cdio.h */
-+ struct ioc_play_track ti;
-+ struct ioc_toc_header tochdr;
-+ struct cd_sub_channel_info sc;
-+#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
-+#define SC_TRACK(sc) (sc.what.position.track_number)
-+#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
-+#else
-+
- /* See /usr/src/linux/include/linux/cdrom.h */
-@@ -158,2 +192,8 @@
- struct cdrom_subchnl sc; /* Subchannel, for time */
-+#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
-+#define SC_TRACK(sc) (sc.cdsc_trk)
-+#define SC_MINUTE(sc) (sc.cdsc_absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
-+#endif
- int volume; /* Must range 0-100 */
---- tcd/tcd.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/tcd.c Tue May 30 15:17:17 2000
-@@ -141,4 +141,4 @@
- stopped anyway, fix it. */
-- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -172,3 +172,3 @@
- if(cd->isplayable) {
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-@@ -442,4 +442,4 @@
- mvwprintw(win,maxy-4,38,"%02u:%02u",
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
-+ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
- mvwprintw(win,maxy-3,38,cd->dtitle );
-@@ -480,3 +480,3 @@
- {
-- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
-+ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
- stat = 'P';
-@@ -484,3 +484,7 @@
- stat = 'R';
-+#if defined(TCD_BSD)
-+ else if(cd->trk[i].toc.control == 0x04)
-+#else
- else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
-+#endif
- stat = 'd';
-@@ -500,3 +504,3 @@
-
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
- attron( A_BOLD );
-@@ -507,3 +511,3 @@
-
-- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
-+ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
- attroff( A_BOLD );
-@@ -518,3 +522,3 @@
{
-- switch( cd->sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd->sc) )
- {
+ make_goto_menu();
diff --git a/audio/gnome-media/files/patch-gmix::gmix.h b/audio/gnome-media/files/patch-gmix::gmix.h
new file mode 100644
index 000000000000..7718b6cd4dba
--- /dev/null
+++ b/audio/gnome-media/files/patch-gmix::gmix.h
@@ -0,0 +1,22 @@
+
+$FreeBSD$
+
+--- gmix/gmix.h 2001/07/13 09:44:04 1.1
++++ gmix/gmix.h 2001/07/13 09:44:44
+@@ -39,6 +39,16 @@
+ /*
+ * All, that is known about a mixer-device
+ */
++#if !defined(OPEN_SOUND_SYSTEM)
++typedef struct mixer_info
++{
++ char id[16];
++ char name[32];
++ int modify_counter;
++ int fillers[10];
++} mixer_info;
++#endif
++
+ typedef struct device_info {
+ #ifdef ALSA
+ snd_mixer_t *handle;
diff --git a/audio/gnome-media/files/patch-tcd::cddb.c b/audio/gnome-media/files/patch-tcd::cddb.c
new file mode 100644
index 000000000000..841fc4c6ba13
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::cddb.c
@@ -0,0 +1,65 @@
+
+$FreeBSD$
+
+--- tcd/cddb.c 2001/07/13 07:50:57 1.1
++++ tcd/cddb.c 2001/07/13 07:55:41
+@@ -199,16 +199,16 @@
+ {
+ int min, sec;
+
+- min = cd->trk[trk].toc.cdte_addr.msf.minute;
+- sec = cd->trk[trk].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[trk]);
++ sec = TOC_SECOND(cd->trk[trk]);
+
+ n = (min*60)+sec;
+- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
++ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
+ }
+ /* Print the number of seconds */
+ fprintf( fp, "#\n# Disc length: %i seconds\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+
+ fprintf( fp, "#\n# Revision: %lu\n", cd->cddb_rev );
+ fprintf( fp, "# Submitted via: tcd 2.0b\n" );
+@@ -245,10 +245,10 @@
+ {
+ int min, sec;
+
+- min = cd->trk[i].toc.cdte_addr.msf.minute;
+- sec = cd->trk[i].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[i]);
++ sec = TOC_SECOND(cd->trk[i]);
+
+- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
++ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
+
+ if(blen>l)
+ {
+@@ -257,8 +257,8 @@
+ }
+ }
+ l=sprintf( tmp, "%i\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+ if(blen>l)
+ strcat( buf,tmp );
+
+@@ -298,9 +298,9 @@
+
+ for( i=0; i <= cd->last_t+1; i++ )
+ {
+- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
+- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
+- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
++ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
++ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
++ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
+ }
+
+
diff --git a/audio/gnome-media/files/patch-tcd::gtcd.c b/audio/gnome-media/files/patch-tcd::gtcd.c
new file mode 100644
index 000000000000..b7ad854ee209
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::gtcd.c
@@ -0,0 +1,100 @@
+
+$FreeBSD$
+
+--- tcd/gtcd.c.orig Mon Jun 11 20:50:57 2001
++++ tcd/gtcd.c Fri Jul 13 12:49:33 2001
+@@ -163,7 +163,11 @@
+ gint release_timer(gpointer *data)
+ {
+ cd.time_lock = TRUE;
++#ifdef TCD_BSD
++ ioctl(cd.cd_dev, CDIOCPAUSE);
++#else
+ ioctl(cd.cd_dev, CDROMPAUSE);
++#endif
+
+ roll_t = gtk_timeout_add(40, (GtkFunction)roll_timer, data);
+ release_t = 0;
+@@ -206,7 +210,11 @@
+ if(GPOINTER_TO_INT(data) > 0)
+ {
+ if((cd.cur_t < cd.last_t) &&
++#ifdef TCD_BSD
++ cd.trk[cd.cur_t+1].toc.control == 0x04)
++#else
+ (cd.trk[cd.cur_t+1].toc.cdte_ctrl != CDROM_DATA_TRACK))
++#endif
+ {
+ cd.cur_t++;
+ tcd_playtracks(&cd,cd.cur_t, cd.last_t, prefs->only_use_trkind);
+@@ -541,8 +549,8 @@
+ break;
+ case TRACK_R: /* track time decending */
+ cur = cd.cur_pos_rel;
+- end = (cd.trk[cd.cur_t].tot_min*60)+
+- cd.trk[cd.cur_t].tot_sec;
++ end = (TOC_MINUTE(cd.trk[cd.cur_t])*60)+
++ TOC_SECOND(cd.trk[cd.cur_t]);
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -555,8 +563,8 @@
+ break;
+ case DISC_R:
+ cur = cd.cur_pos_abs;
+- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
+- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
++ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
++ +TOC_SECOND(cd.trk[cd.last_t+1]));
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -660,7 +668,7 @@
+
+ if( !cd.err )
+ {
+- switch( cd.sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd.sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy(tmp, _("No Disc"));
+@@ -756,8 +764,8 @@
+ }
+
+ /* see if we need to repeat */
+- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd.play_method == REPEAT_CD )
+ tcd_playtracks( &cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -774,14 +782,14 @@
+
+ void status_changed(void)
+ {
+- if(old_status != cd.sc.cdsc_audiostatus)
++ if(old_status != SC_AUDIOSTATUS(cd.sc))
+ {
+ GtkWidget *pixmap;
+ GtkSignalFunc func;
+ char tmp[256];
+ char *name;
+
+- old_status = cd.sc.cdsc_audiostatus;
++ old_status = SC_AUDIOSTATUS(cd.sc);
+ g_snprintf(tmp, 255, "tcd/%s.xpm",
+ (old_status==CDROM_AUDIO_PLAY)?"pause":"play");
+
+@@ -846,7 +854,11 @@
+
+ for(i=1; i <= cd.last_t; i++)
+ {
++#ifdef TCD_BSD
++ data_track = (cd.trk[C(i)].toc.control == 0x04);
++#else
+ data_track = (cd.trk[C(i)].toc.cdte_ctrl == CDROM_DATA_TRACK);
++#endif
+
+ g_snprintf(buf, TRK_NAME_LEN, "%2d - %s", i,
+ data_track ? "[Data]" : cd.trk[C(i)].name);
diff --git a/audio/gnome-media/files/patch-tcd::gtracked.c b/audio/gnome-media/files/patch-tcd::gtracked.c
new file mode 100644
index 000000000000..2fa7e62458b1
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::gtracked.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- tcd/gtracked.c 2001/07/13 08:05:56 1.1
++++ tcd/gtracked.c 2001/07/13 08:06:50
+@@ -211,8 +211,8 @@
+
+ /* Disc area */
+ g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
++ TOC_MINUTE(cd.trk[cd.last_t+1]),
++ TOC_SECOND(cd.trk[cd.last_t+1]));
+
+ disc_frame = gtk_frame_new(tmp);
+ disc_vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
diff --git a/audio/gnome-media/files/patch-tcd::linux-cdrom.c b/audio/gnome-media/files/patch-tcd::linux-cdrom.c
new file mode 100644
index 000000000000..b09f2eaa0f64
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::linux-cdrom.c
@@ -0,0 +1,667 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.c.orig Mon Jun 11 20:50:58 2001
++++ tcd/linux-cdrom.c Fri Jul 13 12:52:22 2001
+@@ -67,6 +67,7 @@
+ return;
+ }
+
++#ifndef TCD_BSD
+ static void decrement_msf_end_by_one (struct cdrom_msf *msf)
+ {
+ if (msf->cdmsf_frame1)
+@@ -87,13 +88,14 @@
+ }
+ }
+ }
++#endif
+
+ int tcd_init_disc( cd_struct *cd, WarnFunc msg_cb )
+ {
+ debug("cdrom.c: tcd_init_disc(%p) top\n", cd );
+ tcd_opencddev( cd, msg_cb );
+
+-#if defined(TCD_CHANGER_ENABLED)
++#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
+ cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
+ #else
+ cd->nslots = 0;
+@@ -131,6 +133,9 @@
+ int tcd_close_disc( cd_struct *cd )
+ {
+ debug("cdrom.c: tcd_close_disc(%p) top\n", cd );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ close(cd->cd_dev);
+ cd->cd_dev = -1;
+ debug("cdrom.c: tcd_close_disc exiting normally\n" );
+@@ -141,6 +146,10 @@
+ {
+ int i;
+ int delsecs;
++#ifdef TCD_BSD
++ struct ioc_read_toc_single_entry tocentry;
++#endif
++
+
+ if(cd->time_lock)
+ return;
+@@ -152,7 +161,11 @@
+ cd->isplayable=FALSE;
+
+ /* read the TOC header */
++#ifdef TCD_BSD
++ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
++#else
+ if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -164,15 +177,29 @@
+ }
+
+ /* grab first & last tracks */
++#ifdef TCD_BSD
++ cd->first_t = cd->tochdr.starting_track;
++ cd->last_t = cd->tochdr.ending_track;
++#else
+ cd->first_t = cd->tochdr.cdth_trk0;
+ cd->last_t = cd->tochdr.cdth_trk1;
++#endif
+
+ /* read the leadout track */
++#ifdef TCD_BSD
++ tocentry.track = 0xaa; /* Magic last track */
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
+ cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
++#endif
+
+ /* read the leadout toc */
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
++#endif
+ {
+ strcpy(cd->errmsg, "Can't read disc.");
+ cd->err = TRUE;
+@@ -184,13 +211,30 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
++ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
++ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++#endif
++
+ /* read the rest of the tocs */
+ for( i = cd->first_t; i <= cd->last_t; i++ )
+ {
++#ifdef TCD_BSD
++ tocentry.track = i;
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(i)].toc.cdte_track = i;
+ cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
++#endif
+
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -201,21 +245,34 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(i)].toc = tocentry.entry;
++ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
++ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
++ TOC_SECOND(cd->trk[C(i)]);
++ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
++ TOC_FRAME(cd->trk[C(i)]);
++#else
+ cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
+ cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
+ cd->trk[C(i)].toc.cdte_addr.msf.second;
+ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
+ cd->trk[C(i)].toc.cdte_addr.msf.frame;
++#endif
+ }
+
+ /* calculate track times */
+ for(i = cd->first_t; i <= cd->last_t; i ++)
+ {
+ /* Taken from cdtool...Thanks Thomas I.! */
++#ifdef TCD_BSD
++ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
++#else
+ delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
+ + cd->trk[C(i+1)].toc.cdte_addr.msf.second
+ - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
+ - cd->trk[C(i)].toc.cdte_addr.msf.second;
++#endif
+
+ cd->trk[C(i)].tot_min = delsecs / 60;
+ cd->trk[C(i)].tot_sec = delsecs - (delsecs/60)*60;
+@@ -245,9 +302,14 @@
+ return;
+
+ /* calculate various timing values */
++#ifdef TCD_BSD
++ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
++ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
++#else
+ cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
+ cd->sc.cdsc_absaddr.msf.second;
+ cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
++#endif
+
+ cd->cur_pos_rel = (cd->cur_frame - cd->trk[C(cd->cur_t)].start) / 75;
+
+@@ -266,10 +328,12 @@
+ cd->cd_min = cd->cur_pos_abs / 60;
+
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ tcd_opencddev( cd, NULL );
+ cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
+ tcd_close_disc ( cd );
+ #endif
++#endif
+ }
+
+ void tcd_recalculate_fake(cd_struct *cd, gint abs_pos, gint track)
+@@ -305,7 +369,11 @@
+
+ for(t = cd->first_t; t <= cd->last_t; t++)
+ {
++#ifdef TCD_BSD
++ if(cd->trk[t].toc.control == 0x04)
++#else
+ if(cd->trk[t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ return t-1;
+ if(abs_pos >= cd->trk[t].start/75)
+ continue;
+@@ -316,16 +384,35 @@
+
+ void tcd_gettime( cd_struct *cd )
+ {
++#ifdef TCD_BSD
++ struct ioc_read_subchannel subch;
++#endif
+ cd->err = FALSE;
++#ifdef TCD_BSD
++ subch.address_format = CD_MSF_FORMAT;
++ subch.data_format = CD_CURRENT_POSITION;
++ subch.data_len = sizeof(cd->sc);
++ subch.track = 0;
++ subch.data = &(cd->sc);
++#else
+ cd->sc.cdsc_format = CDROM_MSF;
++#endif
+
+ if(cd->isplayable)
+ {
+ int tmp;
+ tcd_opencddev (cd, NULL);
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch);
++#else
+ tmp = ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc);
++#endif
+ tcd_close_disc (cd);
++#ifdef TCD_BSD
++ if(tmp == -1)
++#else
+ if(tmp)
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -333,8 +420,18 @@
+ cd->cur_t = 0;
+ return;
+ }
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
++#endif
++ {
++#ifdef TCD_BSD
++ cd->cur_t = SC_TRACK(cd->sc);
++#else
+ cd->cur_t = cd->sc.cdsc_trk;
++#endif
++ }
+ else
+ cd->cur_t = 0;
+ tcd_recalculate(cd);
+@@ -343,14 +440,27 @@
+
+ int tcd_set_volume(cd_struct *cd, int volume)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++#else
+ struct cdrom_volctrl vol;
++#endif
+ int tmp;
+
++#ifdef TCD_BSD
++ vol.vol[0] = volume;
++ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
++#else
+ vol.channel0 = volume;
+ vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
++#endif
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ tmp = ioctl(cd->cd_dev, CDIOCSETVOL, &vol);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMVOLCTRL, &vol);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp < 0)
+ return FALSE;
+@@ -360,6 +470,14 @@
+
+ int tcd_get_volume(cd_struct *cd)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++
++ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
++ return -1;
++
++ return vol.vol[0];
++#else
+ #ifdef CDROMVOLREAD
+ struct cdrom_volctrl vol;
+ int tmp;
+@@ -374,12 +492,38 @@
+ #else
+ return 0;
+ #endif
++#endif
+ }
+
+ void tcd_playtracks(cd_struct *cd, int start_t, int end_t, int only_use_trkind)
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#define MSF_START_MIN (msf.start_m)
++#define MSF_START_SEC (msf.start_s)
++#define MSF_START_FRM (msf.start_f)
++#define MSF_END_MIN (msf.end_m)
++#define MSF_END_SEC (msf.end_s)
++#define MSF_END_FRM (msf.end_f)
++ struct ioc_play_track trkind;
++#define TI_START_TRK (trkind.start_track)
++#define TI_START_IND (trkind.start_index)
++#define TI_END_TRK (trkind.end_track)
++#define TI_END_IND (trkind.end_index)
++#else
+ struct cdrom_msf msf;
++#define MSF_START_MIN (msf.cdmsf_min0)
++#define MSF_START_SEC (msf.cdmsf_sec0)
++#define MSF_START_FRM (msf.cdmsf_frame0)
++#define MSF_END_MIN (msf.cdmsf_min1)
++#define MSF_END_SEC (msf.cdmsf_sec1)
++#define MSF_END_FRM (msf.cdmsf_frame0)
+ struct cdrom_ti trkind;
++#define TI_START_TRK (trkind.cdti_trk0)
++#define TI_START_IND (trkind.cdti_ind0)
++#define TI_END_TRK (trkind.cdti_trk1)
++#define TI_END_IND (trkind.cdti_ind1)
++#endif
+ debug("cdrom.c: tcd_playtracks( %p, %d, %d )\n", cd, start_t, end_t );
+ cd->err = FALSE;
+
+@@ -390,7 +534,7 @@
+ tcd_gettime(cd);
+ if(cd->err)
+ {
+- /* try and inject cd */
++ /* try and eject cd */
+ tcd_ejectcd(cd);
+
+ if(cd->err)
+@@ -401,62 +545,79 @@
+ }
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl(cd->cd_dev, CDIOCCLOSE);
++#else
+ #if defined(CDROMCLOSETRAY)
+ if( ioctl( cd->cd_dev, CDROM_DRIVE_STATUS ) == CDS_TRAY_OPEN )
+ ioctl(cd->cd_dev, CDROMCLOSETRAY);
+ #endif
++#endif
+
++#ifdef TCD_BSD
++ if(cd->trk[start_t].toc.control == 0x04)
++#else
+ if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ start_t++; /* bad hack. most data tracks are the first track... */
+
+- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
++ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
++ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
++ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
+
+ if( end_t < 0 )
+ {
+- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
+- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
+- msf.cdmsf_frame1=0;
++ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
++ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
++ MSF_END_FRM = 0;
+ }
+ else
+ {
+- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if(MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+ }
+- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
+- msf.cdmsf_sec1 %= 60;
++ MSF_END_MIN += (MSF_END_SEC / 60);
++ MSF_END_SEC %= 60;
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
++#else
+ if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
++#endif
+ {
+ debug("cdrom.c: tcd_playtracks error. CDROMPLAYMSF ioctl error (or user override). Trying PLAYTRKIND\n" );
+
+ /* Try alternate method of playing */
+- trkind.cdti_trk0 = start_t; /* start track */
+- trkind.cdti_ind0 = 0; /* start index */
+- trkind.cdti_trk1 = end_t; /* end track */
+- trkind.cdti_ind1 = 0; /* end index */
++ TI_START_TRK = start_t; /* start track */
++ TI_START_IND = 0; /* start index */
++ TI_END_TRK = end_t; /* end track */
++ TI_END_IND = 0; /* end index */
+
++#ifdef TCD_BSD
++ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
++#else
+ if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
++#endif
+ {
+ strcpy( cd->errmsg, "Error playing disc" );
+ cd->err = TRUE;
+@@ -472,25 +633,15 @@
+ return;
+ }
+
+-static int msf_2_frame( cd_min_sec_frame *msf )
+-{
+- return( ( msf->minute * CD_SECS + msf->second )
+- * CD_FRAMES + msf->frame );
+-}
+-
+-static void frame_2_msf( int frame, cd_min_sec_frame *msf )
+-{
+- msf->frame = frame % CD_FRAMES;
+- frame /= CD_FRAMES;
+- msf->second = frame % CD_SECS;
+- msf->minute = frame / CD_SECS;
+-}
+-
+ int tcd_play_seconds( cd_struct *cd, long int offset )
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#else
+ struct cdrom_msf msf;
+ cd_min_sec_frame msf0;
+ int cur_frame, start_frame, end_frame;
++#endif
+ int tmp;
+
+ debug("cdrom.c: tcd_play_seconds( %p, %ld )\n", cd, offset );
+@@ -498,53 +649,54 @@
+ cd->err = FALSE;
+ cd->isplayable=FALSE;
+
+- /* converting msf to frames makes life much easier */
+- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
+- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
+- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
+-
+- /* keep the cur_frame within the boundaries of the first and last track */
+- if ( cur_frame < start_frame ) {
+- cur_frame = start_frame;
+- } else if ( cur_frame > end_frame ) {
+- cur_frame = end_frame;
+- }
+-
+- /* convert frames back to msf */
+- frame_2_msf( cur_frame, &msf0 );
+- msf.cdmsf_min0 = msf0.minute;
+- msf.cdmsf_sec0 = msf0.second;
+- msf.cdmsf_frame0 = msf0.frame;
+- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ /* got subchannel? */
++ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
++ MSF_START_MIN = SC_MINUTE(cd->sc);
++ MSF_START_FRM = SC_FRAME(cd->sc);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if((MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+-
++
++ if(MSF_START_SEC > 60 && (offset<0))
++ {
++ MSF_START_SEC = 60-abs(offset);
++ MSF_START_MIN--;
++ }
++
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT );
++ tmp = ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMPLAYMSF, &msf);
++#endif
+ if(tmp)
+ {
+ strcpy( cd->errmsg, "Error playing disc." );
+ cd->err = TRUE;
+
+ debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW );
++#endif
+ }
+ cd->isplayable=TRUE;
+ tcd_close_disc( cd );
+@@ -562,7 +714,11 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(!ioctl(cd->cd_dev, CDIOCEJECT))
++#else
+ if(!ioctl(cd->cd_dev, CDROMEJECT))
++#endif
+ {
+ cd->isplayable = FALSE;
+ strcpy(cd->errmsg, "No disc in drive ");
+@@ -570,9 +726,17 @@
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
++#else
+ #ifdef CDROMCLOSETRAY
+ tmp = ioctl( cd->cd_dev, CDROMCLOSETRAY );
+ #endif
++#endif
++
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++#endif
+
+ if(tcd_post_init(cd))
+ {
+@@ -582,6 +746,9 @@
+ debug("cdrom.c: tcd_eject - disc init error. %s\n",
+ strerror(errno) );
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ return(-1);
+ }
+ cd->isplayable = TRUE;
+@@ -600,12 +767,21 @@
+ debug("cdrom.c: tcd_stopcd(%p)\n", cd );
+
+ /* SDH: Makes things cleaner on eject */
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
++#else
+ if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
++#endif
+ tcd_pausecd(cd);
+
+ cd->err = FALSE;
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++ tmp = ioctl(cd->cd_dev, CDIOCSTOP);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMSTOP);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp)
+ {
+@@ -626,13 +802,25 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
++#endif
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCRESUME);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMRESUME);
++#endif
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCPAUSE);
++#else
+ tmp=ioctl(cd->cd_dev, CDROMPAUSE);
++#endif
+ }
+ if(tmp < 0)
+ {
+@@ -647,6 +835,7 @@
+ int tcd_change_disc( cd_struct *cd, int disc )
+ {
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ int tmp;
+ cd->err = FALSE;
+
+@@ -657,6 +846,7 @@
+ fprintf( stdout, "ioctl: %s\n", strerror(errno) );
+
+ return tmp;
++#endif
+ #else
+ debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
+ return 0;
diff --git a/audio/gnome-media/files/patch-tcd::linux-cdrom.h b/audio/gnome-media/files/patch-tcd::linux-cdrom.h
new file mode 100644
index 000000000000..dabc669f77d6
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::linux-cdrom.h
@@ -0,0 +1,73 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.h 2001/07/13 09:27:50 1.1
++++ tcd/linux-cdrom.h 2001/07/13 09:34:48
+@@ -27,8 +27,20 @@
+
+ #include <sys/types.h>
+ #include <glib.h>
+-#if !defined(linux) && !defined(sun) && !defined(__sun__)
+-# error TCD only builds on linux and Solaris/SunOs
++#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
++# error TCD only builds on linux, Solaris/SunOs and FreeBSD
++#endif
++
++#ifdef __FreeBSD__
++#define TCD_BSD
++#include <sys/cdio.h>
++#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
++#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
++#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
++#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
++#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
++#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
++#define CDROM
+ #endif
+
+ #ifdef linux
+@@ -126,7 +138,17 @@
+ {
+ char name[TRK_NAME_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this track */
++#ifdef TCD_BSD
++ struct cd_toc_entry toc;
++#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
++#else
+ struct cdrom_tocentry toc;
++#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
++#endif
+ int titled;
+ int start, length;
+ int tot_min, tot_sec;
+@@ -152,10 +174,26 @@
+ char album[DISC_INFO_LEN+1], artist[DISC_INFO_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this disc */
+
++#ifdef TCD_BSD
++ /* See /usr/include/sys/cdio.h */
++ struct ioc_play_track ti;
++ struct ioc_toc_header tochdr;
++ struct cd_sub_channel_info sc;
++#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
++#define SC_TRACK(sc) (sc.what.position.track_number)
++#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
++#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
++#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
++#else
+ /* See /usr/src/linux/include/linux/cdrom.h */
+ struct cdrom_ti ti; /* Track info */
+ struct cdrom_tochdr tochdr; /* TOC header */
+ struct cdrom_subchnl sc; /* Subchannel, for time */
++#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
++#define SC_TRACK(sc) (sc.cdsc_trk)
++#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
++#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
++#endif
+ int volume; /* Must range 0-100 */
+
+ int cd_min, cd_sec; /* Total CD time */
diff --git a/audio/gnome-media/files/patch-tcd::tcd.c b/audio/gnome-media/files/patch-tcd::tcd.c
new file mode 100644
index 000000000000..7946bdbe12ff
--- /dev/null
+++ b/audio/gnome-media/files/patch-tcd::tcd.c
@@ -0,0 +1,79 @@
+
+$FreeBSD$
+
+--- tcd/tcd.c 2001/07/13 09:35:21 1.1
++++ tcd/tcd.c 2001/07/13 09:39:30
+@@ -142,8 +142,8 @@
+
+ /* if the user hasn't stopped the cd, but it is
+ stopped anyway, fix it. */
+- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd->play_method == REPEAT_CD )
+ tcd_playtracks(cd, cd->first_t, cd->last_t, 0);
+@@ -173,7 +173,7 @@
+ case 'p':
+ case 'P':
+ if(cd->isplayable) {
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
+ tcd_pausecd(cd);
+ else
+ tcd_playtracks(cd,cd->first_t,cd->last_t, 0);
+@@ -443,8 +443,8 @@
+ mvwprintw(win,maxy-2,30,"Track:" );
+ attron( C_RED+A_BOLD );
+ mvwprintw(win,maxy-4,38,"%02u:%02u",
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
++ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
+ mvwprintw(win,maxy-3,38,cd->dtitle );
+ attroff( C_RED+A_BOLD );
+ }
+@@ -481,11 +481,15 @@
+ j=height;
+ for(i=cd->first_t; i <= cd->last_t; i++)
+ {
+- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
++ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
+ stat = 'P';
+ else if(cd->repeat_track == i)
+ stat = 'R';
++#ifdef TCD_BSD
++ else if(cd->trk[i].toc.control == 0x04)
++#else
+ else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ stat = 'd';
+ else
+ stat = 'a';
+@@ -501,14 +505,14 @@
+ x = 2;
+ }
+
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
+ attron( A_BOLD );
+
+ mvwprintw(win,y,x,"%02u%c - %02u:%02u",
+ i, stat,cd->trk[C(i)].tot_min,
+ cd->trk[C(i)].tot_sec );
+
+- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
++ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
+ attroff( A_BOLD );
+ }
+ }
+@@ -519,7 +523,7 @@
+
+ if( !cd->err )
+ {
+- switch( cd->sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd->sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy( tmp,"No Audio " );
diff --git a/audio/gnome-media/pkg-plist b/audio/gnome-media/pkg-plist
index 9519b4d3804f..8d5cfa19919c 100644
--- a/audio/gnome-media/pkg-plist
+++ b/audio/gnome-media/pkg-plist
@@ -4,13 +4,55 @@ bin/gmix
bin/grecord
bin/gtcd
bin/vumeter
+etc/CORBA/servers/gtcd.goad
share/gnome/apps/Multimedia/Soundrecorder.desktop
share/gnome/apps/Multimedia/gmix.desktop
share/gnome/apps/Multimedia/gtcd.desktop
share/gnome/apps/Multimedia/vumeter.desktop
share/gnome/cddb-submit-methods
+share/gnome/help/gmix/C/authors.html
+share/gnome/help/gmix/C/bugs.html
+share/gnome/help/gmix/C/figures/gmix-prefs.png
+share/gnome/help/gmix/C/figures/gmix.png
+share/gnome/help/gmix/C/gmix-prefs.html
+share/gnome/help/gmix/C/gmix-use.html
+share/gnome/help/gmix/C/gmix.sgml
+share/gnome/help/gmix/C/index.html
+share/gnome/help/gmix/C/license.html
+share/gnome/help/gmix/C/ln7.html
+share/gnome/help/gmix/C/topic.dat
+share/gnome/help/gmix/it/authors.html
+share/gnome/help/gmix/it/bugs.html
+share/gnome/help/gmix/it/figures/gmix-prefs.png
+share/gnome/help/gmix/it/figures/gmix.png
+share/gnome/help/gmix/it/gmix-prefs.html
+share/gnome/help/gmix/it/gmix-use.html
+share/gnome/help/gmix/it/gmix.sgml
+share/gnome/help/gmix/it/index.html
+share/gnome/help/gmix/it/license.html
+share/gnome/help/gmix/it/ln10.html
+share/gnome/help/gmix/it/topic.dat
+share/gnome/help/gtcd/C/authors.html
+share/gnome/help/gtcd/C/bugs.html
+share/gnome/help/gtcd/C/figures/gtcd-props.png
+share/gnome/help/gtcd/C/figures/gtcd-window.png
+share/gnome/help/gtcd/C/figures/gtcd.png
+share/gnome/help/gtcd/C/figures/track-number.png
+share/gnome/help/gtcd/C/figures/track-time.png
+share/gnome/help/gtcd/C/figures/trackeditor.png
+share/gnome/help/gtcd/C/gtcd.sgml
+share/gnome/help/gtcd/C/index.html
+share/gnome/help/gtcd/C/license.html
+share/gnome/help/gtcd/C/ln7.html
+share/gnome/help/gtcd/C/topic.dat
+share/gnome/help/gtcd/C/usage.html
+share/gnome/idl/gtcd.idl
share/gnome/mime-info/grecord.keys
share/gnome/mime-info/grecord.mime
+share/gnome/omf/gnome-media/gmix-C.omf
+share/gnome/omf/gnome-media/gmix-it.omf
+share/gnome/omf/gnome-media/gtcd-C.omf
+share/gnome/pixmaps/gnome-grecord.png
share/gnome/pixmaps/gnome-mixer.png
share/gnome/pixmaps/gnome-vumeter.png
share/gnome/pixmaps/gtcd.png
@@ -24,6 +66,7 @@ share/gnome/pixmaps/tcd/play.xpm
share/gnome/pixmaps/tcd/prev_t.xpm
share/gnome/pixmaps/tcd/rw.xpm
share/gnome/pixmaps/tcd/stop.xpm
+share/locale/az/LC_MESSAGES/gnome-media.mo
share/locale/ca/LC_MESSAGES/gnome-media.mo
share/locale/cs/LC_MESSAGES/gnome-media.mo
share/locale/da/LC_MESSAGES/gnome-media.mo
@@ -48,9 +91,23 @@ share/locale/pt/LC_MESSAGES/gnome-media.mo
share/locale/pt_BR/LC_MESSAGES/gnome-media.mo
share/locale/ro/LC_MESSAGES/gnome-media.mo
share/locale/ru/LC_MESSAGES/gnome-media.mo
+share/locale/sk/LC_MESSAGES/gnome-media.mo
+share/locale/sl/LC_MESSAGES/gnome-media.mo
share/locale/sv/LC_MESSAGES/gnome-media.mo
share/locale/tr/LC_MESSAGES/gnome-media.mo
share/locale/uk/LC_MESSAGES/gnome-media.mo
share/locale/zh_CN.GB2312/LC_MESSAGES/gnome-media.mo
share/locale/zh_TW.Big5/LC_MESSAGES/gnome-media.mo
-@dirrm share/gnome/pixmaps/tcd/
+@dirrm share/gnome/pixmaps/tcd
+@dirrm share/gnome/omf/gnome-media
+@dirrm share/gnome/help/gtcd/C/stylesheet-images
+@dirrm share/gnome/help/gtcd/C/figures
+@dirrm share/gnome/help/gtcd/C
+@dirrm share/gnome/help/gtcd
+@dirrm share/gnome/help/gmix/it/stylesheet-images
+@dirrm share/gnome/help/gmix/it/figures
+@dirrm share/gnome/help/gmix/it
+@dirrm share/gnome/help/gmix/C/stylesheet-images
+@dirrm share/gnome/help/gmix/C/figures
+@dirrm share/gnome/help/gmix/C
+@dirrm share/gnome/help/gmix
diff --git a/audio/gnomemedia/Makefile b/audio/gnomemedia/Makefile
index 42d4f7abdbc9..cbb0f9b3a05d 100644
--- a/audio/gnomemedia/Makefile
+++ b/audio/gnomemedia/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= gnomemedia
-PORTVERSION= 1.2.0
+PORTVERSION= 1.2.3
CATEGORIES= audio gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= stable/sources/gnome-media
diff --git a/audio/gnomemedia/distinfo b/audio/gnomemedia/distinfo
index 311191fc2cc0..ece2b633d459 100644
--- a/audio/gnomemedia/distinfo
+++ b/audio/gnomemedia/distinfo
@@ -1 +1 @@
-MD5 (gnome-media-1.2.0.tar.gz) = c7cda6054b47f71aa46aaabe9db6fb4c
+MD5 (gnome-media-1.2.3.tar.gz) = bcd99b4fe81141d36bbd40d74a9b448f
diff --git a/audio/gnomemedia/files/patch-ad b/audio/gnomemedia/files/patch-ad
index 8c2d1acfb01f..8f4a302b3334 100644
--- a/audio/gnomemedia/files/patch-ad
+++ b/audio/gnomemedia/files/patch-ad
@@ -1,24 +1,9 @@
---- gmix/gmix.c.orig Sun Feb 21 12:10:17 1999
-+++ gmix/gmix.c Mon Mar 8 20:41:05 1999
-@@ -94,6 +94,17 @@
- /*
- * All, that is known about a mixer-device
- */
-+
-+#if !defined(OPEN_SOUND_SYSTEM)
-+typedef struct mixer_info
-+{
-+ char id[16];
-+ char name[32];
-+ int modify_counter;
-+ int fillers[10];
-+} mixer_info;
-+#endif
-+
- typedef struct device_info {
- int fd;
- mixer_info info;
-@@ -272,11 +283,7 @@
+
+$FreeBSD$
+
+--- gmix/gmix.c.orig Mon Jun 11 20:50:47 2001
++++ gmix/gmix.c Fri Jul 13 12:45:08 2001
+@@ -499,11 +499,7 @@
/*
* open the mixer-device
*/
@@ -30,9 +15,9 @@
+ sprintf(device_name, "/dev/mixer%i", num);
new_device->fd=open(device_name, O_RDWR, 0);
if (new_device->fd<0) {
- free(new_device);
-@@ -291,6 +298,8 @@
- fprintf(stderr, "Warning: This version of gmix was compiled with a different version of\nsoundcard.h.\n");
+ g_free(new_device);
+@@ -535,6 +531,8 @@
+ }
}
#endif
+
@@ -40,7 +25,7 @@
/*
* mixer-name
*/
-@@ -301,6 +310,11 @@
+@@ -545,6 +543,11 @@
}
if(!isalpha(new_device->info.name[0]))
g_snprintf(new_device->info.name, 31, "Card %d", num+1);
@@ -52,7 +37,7 @@
/*
* several bitmasks describing the mixer
*/
-@@ -386,15 +400,16 @@
+@@ -677,15 +680,16 @@
{
int cnt;
device_info *new_device;
@@ -71,4 +56,4 @@
+ || new_device);
}
- void free_one_device(gpointer a, gpointer b)
+ #ifdef ALSA
diff --git a/audio/gnomemedia/files/patch-ae b/audio/gnomemedia/files/patch-ae
index b2878eb5521b..53c2143d301b 100644
--- a/audio/gnomemedia/files/patch-ae
+++ b/audio/gnomemedia/files/patch-ae
@@ -1,789 +1,23 @@
---- tcd/callbacks.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/callbacks.c Tue May 30 15:17:17 2000
-@@ -12,3 +12,3 @@
- {
+
+$FreeBSD$
+
+--- tcd/callbacks.c 2001/07/13 07:48:12 1.1
++++ tcd/callbacks.c 2001/07/13 07:50:36
+@@ -13,7 +13,7 @@
+ {
+ if(!cd.isplayable)
+ return;
- if(cd.sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
+ if(SC_AUDIOSTATUS(cd.sc)==CDROM_AUDIO_PAUSED)
tcd_pausecd(&cd);
-@@ -44,3 +44,3 @@
+ else
+ tcd_playtracks(&cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -45,7 +45,7 @@
+ cd.play_method = NORMAL;
+ cd.repeat_track = -1;
/* SDH: Make sure play/pause state change is noticed */
- cd.sc.cdsc_audiostatus = -1;
+ SC_AUDIOSTATUS(cd.sc) = -1;
if(cd.isplayable)
---- tcd/cddb.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/cddb.c Tue May 30 15:17:17 2000
-@@ -201,7 +201,7 @@
-
-- min = cd->trk[trk].toc.cdte_addr.msf.minute;
-- sec = cd->trk[trk].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[trk]);
-+ sec = TOC_SECOND(cd->trk[trk]);
-
- n = (min*60)+sec;
-- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
-+ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
- }
-@@ -209,4 +209,4 @@
- fprintf( fp, "#\n# Disc length: %i seconds\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
-
-@@ -247,6 +247,6 @@
-
-- min = cd->trk[i].toc.cdte_addr.msf.minute;
-- sec = cd->trk[i].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[i]);
-+ sec = TOC_SECOND(cd->trk[i]);
-
-- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
-+ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
-
-@@ -259,4 +259,4 @@
- l=sprintf( tmp, "%i\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
- if(blen>l)
-@@ -300,5 +300,5 @@
- {
-- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
-- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
-- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
-+ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
-+ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
-+ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
- }
---- tcd/gtcd.c.orig Sun May 21 15:13:04 2000
-+++ tcd/gtcd.c Tue May 30 15:17:17 2000
-@@ -157,3 +157,7 @@
- cd.time_lock = TRUE;
-+#ifdef TCD_BSD
-+ ioctl(cd.cd_dev, CDIOCPAUSE);
-+#else
- ioctl(cd.cd_dev, CDROMPAUSE);
-+#endif
-
-@@ -421,4 +425,4 @@
- cur = cd.cur_pos_abs;
-- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
-- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
-+ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
-+ +TOC_SECOND(cd.trk[cd.last_t+1]));
- pos = end-cur;
-@@ -524,3 +528,3 @@
- {
-- switch( cd.sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd.sc) )
- {
-@@ -620,4 +624,4 @@
- /* see if we need to repeat */
-- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -638,3 +642,3 @@
- {
-- if(old_status != cd.sc.cdsc_audiostatus)
-+ if(old_status != SC_AUDIOSTATUS(cd.sc))
- {
-@@ -645,3 +649,3 @@
-
-- old_status = cd.sc.cdsc_audiostatus;
-+ old_status = SC_AUDIOSTATUS(cd.sc);
- g_snprintf(tmp, 255, "tcd/%s.xpm",
---- tcd/gtracked.c.orig Sun May 21 15:13:05 2000
-+++ tcd/gtracked.c Tue May 30 15:17:17 2000
-@@ -211,4 +211,4 @@
- g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
-+ TOC_MINUTE(cd.trk[cd.last_t+1]),
-+ TOC_SECOND(cd.trk[cd.last_t+1]));
-
---- tcd/linux-cdrom.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.c Tue May 30 15:29:32 2000
-@@ -73,3 +73,3 @@
-
--#if defined(TCD_CHANGER_ENABLED)
-+#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
- cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
-@@ -116,4 +116,7 @@
- {
-- int tmp,i;
-+ int i;
- int delsecs;
-+#ifdef TCD_BSD
-+ struct ioc_read_toc_single_entry tocentry;
-+#endif
-
-@@ -127,3 +130,7 @@
- /* read the TOC header */
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
-+#else
- if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
-+#endif
- {
-@@ -134,2 +141,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -138,11 +148,25 @@
- /* grab first & last tracks */
-+#ifdef TCD_BSD
-+ cd->first_t = cd->tochdr.starting_track;
-+ cd->last_t = cd->tochdr.ending_track;
-+#else
- cd->first_t = cd->tochdr.cdth_trk0;
- cd->last_t = cd->tochdr.cdth_trk1;
-+#endif
-
- /* read the leadout track */
-+#ifdef TCD_BSD
-+ tocentry.track = 0xaa; /* Magic last track */
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
- cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
-+#endif
-
- /* read the leadout toc */
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
-+#endif
- {
-@@ -154,4 +178,15 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-- }
-+ }
-+
-+#ifdef TCD_BSD
-+ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
-+#endif
-+ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
-+ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
-
-@@ -160,6 +195,15 @@
- {
-+#ifdef TCD_BSD
-+ tocentry.track = i;
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(i)].toc.cdte_track = i;
- cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
-+#endif
-
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
-+#endif
- {
-@@ -170,2 +214,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -173,7 +220,12 @@
-
-+#ifdef TCD_BSD
-+ cd->trk[C(i)].toc = tocentry.entry;
-+ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
-+#else
- cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
-- cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
-- cd->trk[C(i)].toc.cdte_addr.msf.second;
-+#endif
-+ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
-+ TOC_SECOND(cd->trk[C(i)]);
- cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
-- cd->trk[C(i)].toc.cdte_addr.msf.frame;
-+ TOC_FRAME(cd->trk[C(i)]);
- }
-@@ -184,6 +236,3 @@
- /* Taken from cdtool...Thanks Thomas I.! */
-- delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
-- + cd->trk[C(i+1)].toc.cdte_addr.msf.second
-- - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
-- - cd->trk[C(i)].toc.cdte_addr.msf.second;
-+ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
-
-@@ -206,3 +255,3 @@
- debug("cdrom.c: tcd_readtoc exiting normally\n" );
-- return tmp;
-+ return 0;
- }
-@@ -216,5 +265,4 @@
- /* calculate various timing values */
-- cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
-- cd->sc.cdsc_absaddr.msf.second;
-- cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
-+ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
-+ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
-
-@@ -237,4 +285,6 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
- #endif
-+#endif
- }
-@@ -284,4 +334,16 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_read_subchannel subch;
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ subch.address_format = CD_MSF_FORMAT;
-+ subch.data_format = CD_CURRENT_POSITION;
-+ subch.data_len = sizeof(cd->sc);
-+ subch.track = 0;
-+ subch.data = &(cd->sc);
-+#else
- cd->sc.cdsc_format = CDROM_MSF;
-+#endif
-
-@@ -289,3 +351,7 @@
- {
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch)) == -1)
-+#else
- if(ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc))
-+#endif
- {
-@@ -295,8 +361,21 @@
- cd->cur_t = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return;
- }
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
-- cd->cur_t = cd->sc.cdsc_trk;
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-+ cd->cur_t = SC_TRACK(cd->sc);
-+ }
- else
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- cd->cur_t = 0;
-+ }
- tcd_recalculate(cd);
-@@ -307,8 +386,21 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+#else
- struct cdrom_volctrl vol;
-+#endif
-
-+#ifdef TCD_BSD
-+ vol.vol[0] = volume;
-+ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
-+#else
- vol.channel0 = volume;
- vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
--
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSETVOL, &vol) < 0)
-+#else
- if(ioctl(cd->cd_dev, CDROMVOLCTRL, &vol) < 0)
-+#endif
- return FALSE;
-@@ -320,2 +412,10 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+
-+ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
-+ return -1;
-+
-+ return vol.vol[0];
-+#else
- #ifdef CDROMVOLREAD
-@@ -330,2 +430,3 @@
- #endif
-+#endif
- }
-@@ -334,4 +435,30 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#define MSF_START_MIN (msf.start_m)
-+#define MSF_START_SEC (msf.start_s)
-+#define MSF_START_FRM (msf.start_f)
-+#define MSF_END_MIN (msf.end_m)
-+#define MSF_END_SEC (msf.end_s)
-+#define MSF_END_FRM (msf.end_f)
-+ struct ioc_play_track trkind;
-+#define TI_START_TRK (trkind.start_track)
-+#define TI_START_IND (trkind.start_index)
-+#define TI_END_TRK (trkind.end_track)
-+#define TI_END_IND (trkind.end_index)
-+#else
- struct cdrom_msf msf;
-+#define MSF_START_MIN (msf.cdmsf_min0)
-+#define MSF_START_SEC (msf.cdmsf_sec0)
-+#define MSF_START_FRM (msf.cdmsf_frame0)
-+#define MSF_END_MIN (msf.cdmsf_min1)
-+#define MSF_END_SEC (msf.cdmsf_sec1)
-+#define MSF_END_FRM (msf.cdmsf_frame0)
- struct cdrom_ti trkind;
-+#define TI_START_TRK (trkind.cdti_trk0)
-+#define TI_START_IND (trkind.cdti_ind0)
-+#define TI_END_TRK (trkind.cdti_trk1)
-+#define TI_END_IND (trkind.cdti_ind1)
-+#endif
-+
- int tmp;
-@@ -344,3 +471,3 @@
- {
-- /* try and inject cd */
-+ /* try and eject cd */
- tcd_ejectcd(cd);
-@@ -354,2 +481,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl(cd->cd_dev, CDIOCCLOSE);
-+#else
- #if defined(CDROMCLOSETRAY)
-@@ -358,9 +488,15 @@
- #endif
--
-+#endif
-+
-+ /* bad hack. most data tracks are the first track... */
-+#ifdef TCD_BSD
-+ if(cd->trk[start_t].toc.control == 0x04)
-+#else
- if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
-- start_t++; /* bad hack. most data tracks are the first track... */
-+#endif
-+ start_t++;
-
-- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
-+ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
-+ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
-+ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
-
-@@ -368,5 +504,5 @@
- {
-- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
-- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
-- msf.cdmsf_frame1=0;
-+ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
-+ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
-+ MSF_END_FRM = 0;
- }
-@@ -374,20 +510,20 @@
- {
-- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame - 1;
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if(MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
-@@ -395,6 +531,11 @@
- }
-- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
-- msf.cdmsf_sec1 %= 60;
-+ MSF_END_MIN += (MSF_END_SEC / 60);
-+ MSF_END_SEC %= 60;
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
-+#endif
- {
-@@ -403,8 +544,12 @@
- /* Try alternate method of playing */
-- trkind.cdti_trk0 = start_t; /* start track */
-- trkind.cdti_ind0 = 0; /* start index */
-- trkind.cdti_trk1 = end_t; /* end track */
-- trkind.cdti_ind1 = 0; /* end index */
-+ TI_START_TRK = start_t; /* start track */
-+ TI_START_IND = 0; /* start index */
-+ TI_END_TRK = end_t; /* end track */
-+ TI_END_IND = 0; /* end index */
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
-+#endif
- {
-@@ -413,2 +558,5 @@
- debug("cdrom.c: tcd_playtracks error. CDROMPLAYTRKIND ioctl error.\n");
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return -1;
-@@ -422,21 +570,10 @@
-
--static int msf_2_frame( cd_min_sec_frame *msf )
--{
-- return( ( msf->minute * CD_SECS + msf->second )
-- * CD_FRAMES + msf->frame );
--}
--
--static void frame_2_msf( int frame, cd_min_sec_frame *msf )
--{
-- msf->frame = frame % CD_FRAMES;
-- frame /= CD_FRAMES;
-- msf->second = frame % CD_SECS;
-- msf->minute = frame / CD_SECS;
--}
--
- int tcd_play_seconds( cd_struct *cd, long int offset )
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#else
- struct cdrom_msf msf;
-- cd_min_sec_frame msf0;
-- int cur_frame, start_frame, end_frame;
-+#endif
-+ int tmp;
-
-@@ -447,41 +584,42 @@
-
-- /* converting msf to frames makes life much easier */
-- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
-- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
-- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
--
-- /* keep the cur_frame within the boundaries of the first and last track */
-- if ( cur_frame < start_frame ) {
-- cur_frame = start_frame;
-- } else if ( cur_frame > end_frame ) {
-- cur_frame = end_frame;
-- }
--
-- /* convert frames back to msf */
-- frame_2_msf( cur_frame, &msf0 );
-- msf.cdmsf_min0 = msf0.minute;
-- msf.cdmsf_sec0 = msf0.second;
-- msf.cdmsf_frame0 = msf0.frame;
-- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame - 1;
-+ /* got subchannel? */
-+ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
-+ MSF_START_MIN = SC_MINUTE(cd->sc);
-+ MSF_START_FRM = SC_FRAME(cd->sc);
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if((MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
- #endif
-+
-+ if(MSF_START_SEC > 60 && (offset<0))
-+ {
-+ MSF_START_SEC = 60-abs(offset);
-+ MSF_START_MIN--;
-+ }
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT );
-+#endif
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYMSF, &msf))
-+#endif
- {
-@@ -491,2 +629,5 @@
- debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW );
-+#endif
- return(-1);
-@@ -507,3 +648,11 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(!ioctl(cd->cd_dev, CDIOCEJECT))
-+#else
- if(!ioctl(cd->cd_dev, CDROMEJECT))
-+#endif
- {
-@@ -515,2 +664,5 @@
- {
-+#ifdef TCD_BSD
-+ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
-+#else
- #ifdef CDROMCLOSETRAY
-@@ -518,2 +670,7 @@
- #endif
-+#endif
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-
-@@ -527,2 +684,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -544,7 +704,15 @@
- /* SDH: Makes things cleaner on eject */
-- if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSTOP))
-+#else
- if(ioctl(cd->cd_dev, CDROMSTOP))
-+#endif
- {
-@@ -566,5 +734,9 @@
-
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
-- {
-+ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
-+ {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCRESUME)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMRESUME)))
-+#endif
- {
-@@ -572,4 +744,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -578,3 +756,7 @@
- {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCPAUSE)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMPAUSE)))
-+#endif
- {
-@@ -582,4 +764,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -591,2 +779,3 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- int tmp;
-@@ -599,6 +788,6 @@
- return tmp;
--#else
-+#endif
-+#endif
- debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
- return 0;
--#endif
- }
---- tcd/linux-cdrom.h.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.h Tue May 30 15:34:32 2000
-@@ -29,4 +29,16 @@
- #include <glib.h>
--#if !defined(linux) && !defined(sun) && !defined(__sun__)
--# error TCD only builds on linux and Solaris/SunOs
-+#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
-+# error TCD only builds on Linux, Solaris, SunOS, and FreeBSD
-+#endif
-+
-+#ifdef __FreeBSD__
-+#define TCD_BSD
-+#include <sys/cdio.h>
-+#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
-+#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
-+#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
-+#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
-+#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
-+#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
-+#define CDROM
- #endif
-@@ -128,3 +140,13 @@
- char extd[EXT_DATA_LEN+1]; /* extra information for this track */
-+#ifdef TCD_BSD
-+ struct cd_toc_entry toc;
-+#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
-+#else
- struct cdrom_tocentry toc;
-+#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
-+#endif
- int titled;
-@@ -154,2 +176,14 @@
-
-+#ifdef TCD_BSD
-+ /* See /usr/include/sys/cdio.h */
-+ struct ioc_play_track ti;
-+ struct ioc_toc_header tochdr;
-+ struct cd_sub_channel_info sc;
-+#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
-+#define SC_TRACK(sc) (sc.what.position.track_number)
-+#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
-+#else
-+
- /* See /usr/src/linux/include/linux/cdrom.h */
-@@ -158,2 +192,8 @@
- struct cdrom_subchnl sc; /* Subchannel, for time */
-+#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
-+#define SC_TRACK(sc) (sc.cdsc_trk)
-+#define SC_MINUTE(sc) (sc.cdsc_absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
-+#endif
- int volume; /* Must range 0-100 */
---- tcd/tcd.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/tcd.c Tue May 30 15:17:17 2000
-@@ -141,4 +141,4 @@
- stopped anyway, fix it. */
-- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -172,3 +172,3 @@
- if(cd->isplayable) {
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-@@ -442,4 +442,4 @@
- mvwprintw(win,maxy-4,38,"%02u:%02u",
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
-+ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
- mvwprintw(win,maxy-3,38,cd->dtitle );
-@@ -480,3 +480,3 @@
- {
-- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
-+ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
- stat = 'P';
-@@ -484,3 +484,7 @@
- stat = 'R';
-+#if defined(TCD_BSD)
-+ else if(cd->trk[i].toc.control == 0x04)
-+#else
- else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
-+#endif
- stat = 'd';
-@@ -500,3 +504,3 @@
-
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
- attron( A_BOLD );
-@@ -507,3 +511,3 @@
-
-- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
-+ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
- attroff( A_BOLD );
-@@ -518,3 +522,3 @@
{
-- switch( cd->sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd->sc) )
- {
+ make_goto_menu();
diff --git a/audio/gnomemedia/files/patch-gmix::gmix.h b/audio/gnomemedia/files/patch-gmix::gmix.h
new file mode 100644
index 000000000000..7718b6cd4dba
--- /dev/null
+++ b/audio/gnomemedia/files/patch-gmix::gmix.h
@@ -0,0 +1,22 @@
+
+$FreeBSD$
+
+--- gmix/gmix.h 2001/07/13 09:44:04 1.1
++++ gmix/gmix.h 2001/07/13 09:44:44
+@@ -39,6 +39,16 @@
+ /*
+ * All, that is known about a mixer-device
+ */
++#if !defined(OPEN_SOUND_SYSTEM)
++typedef struct mixer_info
++{
++ char id[16];
++ char name[32];
++ int modify_counter;
++ int fillers[10];
++} mixer_info;
++#endif
++
+ typedef struct device_info {
+ #ifdef ALSA
+ snd_mixer_t *handle;
diff --git a/audio/gnomemedia/files/patch-tcd::cddb.c b/audio/gnomemedia/files/patch-tcd::cddb.c
new file mode 100644
index 000000000000..841fc4c6ba13
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::cddb.c
@@ -0,0 +1,65 @@
+
+$FreeBSD$
+
+--- tcd/cddb.c 2001/07/13 07:50:57 1.1
++++ tcd/cddb.c 2001/07/13 07:55:41
+@@ -199,16 +199,16 @@
+ {
+ int min, sec;
+
+- min = cd->trk[trk].toc.cdte_addr.msf.minute;
+- sec = cd->trk[trk].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[trk]);
++ sec = TOC_SECOND(cd->trk[trk]);
+
+ n = (min*60)+sec;
+- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
++ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
+ }
+ /* Print the number of seconds */
+ fprintf( fp, "#\n# Disc length: %i seconds\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+
+ fprintf( fp, "#\n# Revision: %lu\n", cd->cddb_rev );
+ fprintf( fp, "# Submitted via: tcd 2.0b\n" );
+@@ -245,10 +245,10 @@
+ {
+ int min, sec;
+
+- min = cd->trk[i].toc.cdte_addr.msf.minute;
+- sec = cd->trk[i].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[i]);
++ sec = TOC_SECOND(cd->trk[i]);
+
+- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
++ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
+
+ if(blen>l)
+ {
+@@ -257,8 +257,8 @@
+ }
+ }
+ l=sprintf( tmp, "%i\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+ if(blen>l)
+ strcat( buf,tmp );
+
+@@ -298,9 +298,9 @@
+
+ for( i=0; i <= cd->last_t+1; i++ )
+ {
+- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
+- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
+- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
++ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
++ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
++ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
+ }
+
+
diff --git a/audio/gnomemedia/files/patch-tcd::gtcd.c b/audio/gnomemedia/files/patch-tcd::gtcd.c
new file mode 100644
index 000000000000..b7ad854ee209
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::gtcd.c
@@ -0,0 +1,100 @@
+
+$FreeBSD$
+
+--- tcd/gtcd.c.orig Mon Jun 11 20:50:57 2001
++++ tcd/gtcd.c Fri Jul 13 12:49:33 2001
+@@ -163,7 +163,11 @@
+ gint release_timer(gpointer *data)
+ {
+ cd.time_lock = TRUE;
++#ifdef TCD_BSD
++ ioctl(cd.cd_dev, CDIOCPAUSE);
++#else
+ ioctl(cd.cd_dev, CDROMPAUSE);
++#endif
+
+ roll_t = gtk_timeout_add(40, (GtkFunction)roll_timer, data);
+ release_t = 0;
+@@ -206,7 +210,11 @@
+ if(GPOINTER_TO_INT(data) > 0)
+ {
+ if((cd.cur_t < cd.last_t) &&
++#ifdef TCD_BSD
++ cd.trk[cd.cur_t+1].toc.control == 0x04)
++#else
+ (cd.trk[cd.cur_t+1].toc.cdte_ctrl != CDROM_DATA_TRACK))
++#endif
+ {
+ cd.cur_t++;
+ tcd_playtracks(&cd,cd.cur_t, cd.last_t, prefs->only_use_trkind);
+@@ -541,8 +549,8 @@
+ break;
+ case TRACK_R: /* track time decending */
+ cur = cd.cur_pos_rel;
+- end = (cd.trk[cd.cur_t].tot_min*60)+
+- cd.trk[cd.cur_t].tot_sec;
++ end = (TOC_MINUTE(cd.trk[cd.cur_t])*60)+
++ TOC_SECOND(cd.trk[cd.cur_t]);
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -555,8 +563,8 @@
+ break;
+ case DISC_R:
+ cur = cd.cur_pos_abs;
+- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
+- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
++ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
++ +TOC_SECOND(cd.trk[cd.last_t+1]));
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -660,7 +668,7 @@
+
+ if( !cd.err )
+ {
+- switch( cd.sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd.sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy(tmp, _("No Disc"));
+@@ -756,8 +764,8 @@
+ }
+
+ /* see if we need to repeat */
+- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd.play_method == REPEAT_CD )
+ tcd_playtracks( &cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -774,14 +782,14 @@
+
+ void status_changed(void)
+ {
+- if(old_status != cd.sc.cdsc_audiostatus)
++ if(old_status != SC_AUDIOSTATUS(cd.sc))
+ {
+ GtkWidget *pixmap;
+ GtkSignalFunc func;
+ char tmp[256];
+ char *name;
+
+- old_status = cd.sc.cdsc_audiostatus;
++ old_status = SC_AUDIOSTATUS(cd.sc);
+ g_snprintf(tmp, 255, "tcd/%s.xpm",
+ (old_status==CDROM_AUDIO_PLAY)?"pause":"play");
+
+@@ -846,7 +854,11 @@
+
+ for(i=1; i <= cd.last_t; i++)
+ {
++#ifdef TCD_BSD
++ data_track = (cd.trk[C(i)].toc.control == 0x04);
++#else
+ data_track = (cd.trk[C(i)].toc.cdte_ctrl == CDROM_DATA_TRACK);
++#endif
+
+ g_snprintf(buf, TRK_NAME_LEN, "%2d - %s", i,
+ data_track ? "[Data]" : cd.trk[C(i)].name);
diff --git a/audio/gnomemedia/files/patch-tcd::gtracked.c b/audio/gnomemedia/files/patch-tcd::gtracked.c
new file mode 100644
index 000000000000..2fa7e62458b1
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::gtracked.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- tcd/gtracked.c 2001/07/13 08:05:56 1.1
++++ tcd/gtracked.c 2001/07/13 08:06:50
+@@ -211,8 +211,8 @@
+
+ /* Disc area */
+ g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
++ TOC_MINUTE(cd.trk[cd.last_t+1]),
++ TOC_SECOND(cd.trk[cd.last_t+1]));
+
+ disc_frame = gtk_frame_new(tmp);
+ disc_vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
diff --git a/audio/gnomemedia/files/patch-tcd::linux-cdrom.c b/audio/gnomemedia/files/patch-tcd::linux-cdrom.c
new file mode 100644
index 000000000000..b09f2eaa0f64
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::linux-cdrom.c
@@ -0,0 +1,667 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.c.orig Mon Jun 11 20:50:58 2001
++++ tcd/linux-cdrom.c Fri Jul 13 12:52:22 2001
+@@ -67,6 +67,7 @@
+ return;
+ }
+
++#ifndef TCD_BSD
+ static void decrement_msf_end_by_one (struct cdrom_msf *msf)
+ {
+ if (msf->cdmsf_frame1)
+@@ -87,13 +88,14 @@
+ }
+ }
+ }
++#endif
+
+ int tcd_init_disc( cd_struct *cd, WarnFunc msg_cb )
+ {
+ debug("cdrom.c: tcd_init_disc(%p) top\n", cd );
+ tcd_opencddev( cd, msg_cb );
+
+-#if defined(TCD_CHANGER_ENABLED)
++#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
+ cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
+ #else
+ cd->nslots = 0;
+@@ -131,6 +133,9 @@
+ int tcd_close_disc( cd_struct *cd )
+ {
+ debug("cdrom.c: tcd_close_disc(%p) top\n", cd );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ close(cd->cd_dev);
+ cd->cd_dev = -1;
+ debug("cdrom.c: tcd_close_disc exiting normally\n" );
+@@ -141,6 +146,10 @@
+ {
+ int i;
+ int delsecs;
++#ifdef TCD_BSD
++ struct ioc_read_toc_single_entry tocentry;
++#endif
++
+
+ if(cd->time_lock)
+ return;
+@@ -152,7 +161,11 @@
+ cd->isplayable=FALSE;
+
+ /* read the TOC header */
++#ifdef TCD_BSD
++ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
++#else
+ if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -164,15 +177,29 @@
+ }
+
+ /* grab first & last tracks */
++#ifdef TCD_BSD
++ cd->first_t = cd->tochdr.starting_track;
++ cd->last_t = cd->tochdr.ending_track;
++#else
+ cd->first_t = cd->tochdr.cdth_trk0;
+ cd->last_t = cd->tochdr.cdth_trk1;
++#endif
+
+ /* read the leadout track */
++#ifdef TCD_BSD
++ tocentry.track = 0xaa; /* Magic last track */
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
+ cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
++#endif
+
+ /* read the leadout toc */
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
++#endif
+ {
+ strcpy(cd->errmsg, "Can't read disc.");
+ cd->err = TRUE;
+@@ -184,13 +211,30 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
++ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
++ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++#endif
++
+ /* read the rest of the tocs */
+ for( i = cd->first_t; i <= cd->last_t; i++ )
+ {
++#ifdef TCD_BSD
++ tocentry.track = i;
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(i)].toc.cdte_track = i;
+ cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
++#endif
+
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -201,21 +245,34 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(i)].toc = tocentry.entry;
++ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
++ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
++ TOC_SECOND(cd->trk[C(i)]);
++ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
++ TOC_FRAME(cd->trk[C(i)]);
++#else
+ cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
+ cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
+ cd->trk[C(i)].toc.cdte_addr.msf.second;
+ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
+ cd->trk[C(i)].toc.cdte_addr.msf.frame;
++#endif
+ }
+
+ /* calculate track times */
+ for(i = cd->first_t; i <= cd->last_t; i ++)
+ {
+ /* Taken from cdtool...Thanks Thomas I.! */
++#ifdef TCD_BSD
++ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
++#else
+ delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
+ + cd->trk[C(i+1)].toc.cdte_addr.msf.second
+ - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
+ - cd->trk[C(i)].toc.cdte_addr.msf.second;
++#endif
+
+ cd->trk[C(i)].tot_min = delsecs / 60;
+ cd->trk[C(i)].tot_sec = delsecs - (delsecs/60)*60;
+@@ -245,9 +302,14 @@
+ return;
+
+ /* calculate various timing values */
++#ifdef TCD_BSD
++ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
++ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
++#else
+ cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
+ cd->sc.cdsc_absaddr.msf.second;
+ cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
++#endif
+
+ cd->cur_pos_rel = (cd->cur_frame - cd->trk[C(cd->cur_t)].start) / 75;
+
+@@ -266,10 +328,12 @@
+ cd->cd_min = cd->cur_pos_abs / 60;
+
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ tcd_opencddev( cd, NULL );
+ cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
+ tcd_close_disc ( cd );
+ #endif
++#endif
+ }
+
+ void tcd_recalculate_fake(cd_struct *cd, gint abs_pos, gint track)
+@@ -305,7 +369,11 @@
+
+ for(t = cd->first_t; t <= cd->last_t; t++)
+ {
++#ifdef TCD_BSD
++ if(cd->trk[t].toc.control == 0x04)
++#else
+ if(cd->trk[t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ return t-1;
+ if(abs_pos >= cd->trk[t].start/75)
+ continue;
+@@ -316,16 +384,35 @@
+
+ void tcd_gettime( cd_struct *cd )
+ {
++#ifdef TCD_BSD
++ struct ioc_read_subchannel subch;
++#endif
+ cd->err = FALSE;
++#ifdef TCD_BSD
++ subch.address_format = CD_MSF_FORMAT;
++ subch.data_format = CD_CURRENT_POSITION;
++ subch.data_len = sizeof(cd->sc);
++ subch.track = 0;
++ subch.data = &(cd->sc);
++#else
+ cd->sc.cdsc_format = CDROM_MSF;
++#endif
+
+ if(cd->isplayable)
+ {
+ int tmp;
+ tcd_opencddev (cd, NULL);
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch);
++#else
+ tmp = ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc);
++#endif
+ tcd_close_disc (cd);
++#ifdef TCD_BSD
++ if(tmp == -1)
++#else
+ if(tmp)
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -333,8 +420,18 @@
+ cd->cur_t = 0;
+ return;
+ }
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
++#endif
++ {
++#ifdef TCD_BSD
++ cd->cur_t = SC_TRACK(cd->sc);
++#else
+ cd->cur_t = cd->sc.cdsc_trk;
++#endif
++ }
+ else
+ cd->cur_t = 0;
+ tcd_recalculate(cd);
+@@ -343,14 +440,27 @@
+
+ int tcd_set_volume(cd_struct *cd, int volume)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++#else
+ struct cdrom_volctrl vol;
++#endif
+ int tmp;
+
++#ifdef TCD_BSD
++ vol.vol[0] = volume;
++ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
++#else
+ vol.channel0 = volume;
+ vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
++#endif
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ tmp = ioctl(cd->cd_dev, CDIOCSETVOL, &vol);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMVOLCTRL, &vol);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp < 0)
+ return FALSE;
+@@ -360,6 +470,14 @@
+
+ int tcd_get_volume(cd_struct *cd)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++
++ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
++ return -1;
++
++ return vol.vol[0];
++#else
+ #ifdef CDROMVOLREAD
+ struct cdrom_volctrl vol;
+ int tmp;
+@@ -374,12 +492,38 @@
+ #else
+ return 0;
+ #endif
++#endif
+ }
+
+ void tcd_playtracks(cd_struct *cd, int start_t, int end_t, int only_use_trkind)
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#define MSF_START_MIN (msf.start_m)
++#define MSF_START_SEC (msf.start_s)
++#define MSF_START_FRM (msf.start_f)
++#define MSF_END_MIN (msf.end_m)
++#define MSF_END_SEC (msf.end_s)
++#define MSF_END_FRM (msf.end_f)
++ struct ioc_play_track trkind;
++#define TI_START_TRK (trkind.start_track)
++#define TI_START_IND (trkind.start_index)
++#define TI_END_TRK (trkind.end_track)
++#define TI_END_IND (trkind.end_index)
++#else
+ struct cdrom_msf msf;
++#define MSF_START_MIN (msf.cdmsf_min0)
++#define MSF_START_SEC (msf.cdmsf_sec0)
++#define MSF_START_FRM (msf.cdmsf_frame0)
++#define MSF_END_MIN (msf.cdmsf_min1)
++#define MSF_END_SEC (msf.cdmsf_sec1)
++#define MSF_END_FRM (msf.cdmsf_frame0)
+ struct cdrom_ti trkind;
++#define TI_START_TRK (trkind.cdti_trk0)
++#define TI_START_IND (trkind.cdti_ind0)
++#define TI_END_TRK (trkind.cdti_trk1)
++#define TI_END_IND (trkind.cdti_ind1)
++#endif
+ debug("cdrom.c: tcd_playtracks( %p, %d, %d )\n", cd, start_t, end_t );
+ cd->err = FALSE;
+
+@@ -390,7 +534,7 @@
+ tcd_gettime(cd);
+ if(cd->err)
+ {
+- /* try and inject cd */
++ /* try and eject cd */
+ tcd_ejectcd(cd);
+
+ if(cd->err)
+@@ -401,62 +545,79 @@
+ }
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl(cd->cd_dev, CDIOCCLOSE);
++#else
+ #if defined(CDROMCLOSETRAY)
+ if( ioctl( cd->cd_dev, CDROM_DRIVE_STATUS ) == CDS_TRAY_OPEN )
+ ioctl(cd->cd_dev, CDROMCLOSETRAY);
+ #endif
++#endif
+
++#ifdef TCD_BSD
++ if(cd->trk[start_t].toc.control == 0x04)
++#else
+ if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ start_t++; /* bad hack. most data tracks are the first track... */
+
+- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
++ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
++ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
++ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
+
+ if( end_t < 0 )
+ {
+- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
+- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
+- msf.cdmsf_frame1=0;
++ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
++ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
++ MSF_END_FRM = 0;
+ }
+ else
+ {
+- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if(MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+ }
+- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
+- msf.cdmsf_sec1 %= 60;
++ MSF_END_MIN += (MSF_END_SEC / 60);
++ MSF_END_SEC %= 60;
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
++#else
+ if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
++#endif
+ {
+ debug("cdrom.c: tcd_playtracks error. CDROMPLAYMSF ioctl error (or user override). Trying PLAYTRKIND\n" );
+
+ /* Try alternate method of playing */
+- trkind.cdti_trk0 = start_t; /* start track */
+- trkind.cdti_ind0 = 0; /* start index */
+- trkind.cdti_trk1 = end_t; /* end track */
+- trkind.cdti_ind1 = 0; /* end index */
++ TI_START_TRK = start_t; /* start track */
++ TI_START_IND = 0; /* start index */
++ TI_END_TRK = end_t; /* end track */
++ TI_END_IND = 0; /* end index */
+
++#ifdef TCD_BSD
++ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
++#else
+ if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
++#endif
+ {
+ strcpy( cd->errmsg, "Error playing disc" );
+ cd->err = TRUE;
+@@ -472,25 +633,15 @@
+ return;
+ }
+
+-static int msf_2_frame( cd_min_sec_frame *msf )
+-{
+- return( ( msf->minute * CD_SECS + msf->second )
+- * CD_FRAMES + msf->frame );
+-}
+-
+-static void frame_2_msf( int frame, cd_min_sec_frame *msf )
+-{
+- msf->frame = frame % CD_FRAMES;
+- frame /= CD_FRAMES;
+- msf->second = frame % CD_SECS;
+- msf->minute = frame / CD_SECS;
+-}
+-
+ int tcd_play_seconds( cd_struct *cd, long int offset )
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#else
+ struct cdrom_msf msf;
+ cd_min_sec_frame msf0;
+ int cur_frame, start_frame, end_frame;
++#endif
+ int tmp;
+
+ debug("cdrom.c: tcd_play_seconds( %p, %ld )\n", cd, offset );
+@@ -498,53 +649,54 @@
+ cd->err = FALSE;
+ cd->isplayable=FALSE;
+
+- /* converting msf to frames makes life much easier */
+- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
+- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
+- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
+-
+- /* keep the cur_frame within the boundaries of the first and last track */
+- if ( cur_frame < start_frame ) {
+- cur_frame = start_frame;
+- } else if ( cur_frame > end_frame ) {
+- cur_frame = end_frame;
+- }
+-
+- /* convert frames back to msf */
+- frame_2_msf( cur_frame, &msf0 );
+- msf.cdmsf_min0 = msf0.minute;
+- msf.cdmsf_sec0 = msf0.second;
+- msf.cdmsf_frame0 = msf0.frame;
+- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ /* got subchannel? */
++ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
++ MSF_START_MIN = SC_MINUTE(cd->sc);
++ MSF_START_FRM = SC_FRAME(cd->sc);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if((MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+-
++
++ if(MSF_START_SEC > 60 && (offset<0))
++ {
++ MSF_START_SEC = 60-abs(offset);
++ MSF_START_MIN--;
++ }
++
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT );
++ tmp = ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMPLAYMSF, &msf);
++#endif
+ if(tmp)
+ {
+ strcpy( cd->errmsg, "Error playing disc." );
+ cd->err = TRUE;
+
+ debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW );
++#endif
+ }
+ cd->isplayable=TRUE;
+ tcd_close_disc( cd );
+@@ -562,7 +714,11 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(!ioctl(cd->cd_dev, CDIOCEJECT))
++#else
+ if(!ioctl(cd->cd_dev, CDROMEJECT))
++#endif
+ {
+ cd->isplayable = FALSE;
+ strcpy(cd->errmsg, "No disc in drive ");
+@@ -570,9 +726,17 @@
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
++#else
+ #ifdef CDROMCLOSETRAY
+ tmp = ioctl( cd->cd_dev, CDROMCLOSETRAY );
+ #endif
++#endif
++
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++#endif
+
+ if(tcd_post_init(cd))
+ {
+@@ -582,6 +746,9 @@
+ debug("cdrom.c: tcd_eject - disc init error. %s\n",
+ strerror(errno) );
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ return(-1);
+ }
+ cd->isplayable = TRUE;
+@@ -600,12 +767,21 @@
+ debug("cdrom.c: tcd_stopcd(%p)\n", cd );
+
+ /* SDH: Makes things cleaner on eject */
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
++#else
+ if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
++#endif
+ tcd_pausecd(cd);
+
+ cd->err = FALSE;
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++ tmp = ioctl(cd->cd_dev, CDIOCSTOP);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMSTOP);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp)
+ {
+@@ -626,13 +802,25 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
++#endif
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCRESUME);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMRESUME);
++#endif
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCPAUSE);
++#else
+ tmp=ioctl(cd->cd_dev, CDROMPAUSE);
++#endif
+ }
+ if(tmp < 0)
+ {
+@@ -647,6 +835,7 @@
+ int tcd_change_disc( cd_struct *cd, int disc )
+ {
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ int tmp;
+ cd->err = FALSE;
+
+@@ -657,6 +846,7 @@
+ fprintf( stdout, "ioctl: %s\n", strerror(errno) );
+
+ return tmp;
++#endif
+ #else
+ debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
+ return 0;
diff --git a/audio/gnomemedia/files/patch-tcd::linux-cdrom.h b/audio/gnomemedia/files/patch-tcd::linux-cdrom.h
new file mode 100644
index 000000000000..dabc669f77d6
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::linux-cdrom.h
@@ -0,0 +1,73 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.h 2001/07/13 09:27:50 1.1
++++ tcd/linux-cdrom.h 2001/07/13 09:34:48
+@@ -27,8 +27,20 @@
+
+ #include <sys/types.h>
+ #include <glib.h>
+-#if !defined(linux) && !defined(sun) && !defined(__sun__)
+-# error TCD only builds on linux and Solaris/SunOs
++#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
++# error TCD only builds on linux, Solaris/SunOs and FreeBSD
++#endif
++
++#ifdef __FreeBSD__
++#define TCD_BSD
++#include <sys/cdio.h>
++#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
++#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
++#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
++#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
++#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
++#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
++#define CDROM
+ #endif
+
+ #ifdef linux
+@@ -126,7 +138,17 @@
+ {
+ char name[TRK_NAME_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this track */
++#ifdef TCD_BSD
++ struct cd_toc_entry toc;
++#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
++#else
+ struct cdrom_tocentry toc;
++#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
++#endif
+ int titled;
+ int start, length;
+ int tot_min, tot_sec;
+@@ -152,10 +174,26 @@
+ char album[DISC_INFO_LEN+1], artist[DISC_INFO_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this disc */
+
++#ifdef TCD_BSD
++ /* See /usr/include/sys/cdio.h */
++ struct ioc_play_track ti;
++ struct ioc_toc_header tochdr;
++ struct cd_sub_channel_info sc;
++#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
++#define SC_TRACK(sc) (sc.what.position.track_number)
++#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
++#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
++#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
++#else
+ /* See /usr/src/linux/include/linux/cdrom.h */
+ struct cdrom_ti ti; /* Track info */
+ struct cdrom_tochdr tochdr; /* TOC header */
+ struct cdrom_subchnl sc; /* Subchannel, for time */
++#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
++#define SC_TRACK(sc) (sc.cdsc_trk)
++#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
++#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
++#endif
+ int volume; /* Must range 0-100 */
+
+ int cd_min, cd_sec; /* Total CD time */
diff --git a/audio/gnomemedia/files/patch-tcd::tcd.c b/audio/gnomemedia/files/patch-tcd::tcd.c
new file mode 100644
index 000000000000..7946bdbe12ff
--- /dev/null
+++ b/audio/gnomemedia/files/patch-tcd::tcd.c
@@ -0,0 +1,79 @@
+
+$FreeBSD$
+
+--- tcd/tcd.c 2001/07/13 09:35:21 1.1
++++ tcd/tcd.c 2001/07/13 09:39:30
+@@ -142,8 +142,8 @@
+
+ /* if the user hasn't stopped the cd, but it is
+ stopped anyway, fix it. */
+- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd->play_method == REPEAT_CD )
+ tcd_playtracks(cd, cd->first_t, cd->last_t, 0);
+@@ -173,7 +173,7 @@
+ case 'p':
+ case 'P':
+ if(cd->isplayable) {
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
+ tcd_pausecd(cd);
+ else
+ tcd_playtracks(cd,cd->first_t,cd->last_t, 0);
+@@ -443,8 +443,8 @@
+ mvwprintw(win,maxy-2,30,"Track:" );
+ attron( C_RED+A_BOLD );
+ mvwprintw(win,maxy-4,38,"%02u:%02u",
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
++ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
+ mvwprintw(win,maxy-3,38,cd->dtitle );
+ attroff( C_RED+A_BOLD );
+ }
+@@ -481,11 +481,15 @@
+ j=height;
+ for(i=cd->first_t; i <= cd->last_t; i++)
+ {
+- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
++ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
+ stat = 'P';
+ else if(cd->repeat_track == i)
+ stat = 'R';
++#ifdef TCD_BSD
++ else if(cd->trk[i].toc.control == 0x04)
++#else
+ else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ stat = 'd';
+ else
+ stat = 'a';
+@@ -501,14 +505,14 @@
+ x = 2;
+ }
+
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
+ attron( A_BOLD );
+
+ mvwprintw(win,y,x,"%02u%c - %02u:%02u",
+ i, stat,cd->trk[C(i)].tot_min,
+ cd->trk[C(i)].tot_sec );
+
+- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
++ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
+ attroff( A_BOLD );
+ }
+ }
+@@ -519,7 +523,7 @@
+
+ if( !cd->err )
+ {
+- switch( cd->sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd->sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy( tmp,"No Audio " );
diff --git a/audio/gnomemedia/pkg-plist b/audio/gnomemedia/pkg-plist
index 9519b4d3804f..8d5cfa19919c 100644
--- a/audio/gnomemedia/pkg-plist
+++ b/audio/gnomemedia/pkg-plist
@@ -4,13 +4,55 @@ bin/gmix
bin/grecord
bin/gtcd
bin/vumeter
+etc/CORBA/servers/gtcd.goad
share/gnome/apps/Multimedia/Soundrecorder.desktop
share/gnome/apps/Multimedia/gmix.desktop
share/gnome/apps/Multimedia/gtcd.desktop
share/gnome/apps/Multimedia/vumeter.desktop
share/gnome/cddb-submit-methods
+share/gnome/help/gmix/C/authors.html
+share/gnome/help/gmix/C/bugs.html
+share/gnome/help/gmix/C/figures/gmix-prefs.png
+share/gnome/help/gmix/C/figures/gmix.png
+share/gnome/help/gmix/C/gmix-prefs.html
+share/gnome/help/gmix/C/gmix-use.html
+share/gnome/help/gmix/C/gmix.sgml
+share/gnome/help/gmix/C/index.html
+share/gnome/help/gmix/C/license.html
+share/gnome/help/gmix/C/ln7.html
+share/gnome/help/gmix/C/topic.dat
+share/gnome/help/gmix/it/authors.html
+share/gnome/help/gmix/it/bugs.html
+share/gnome/help/gmix/it/figures/gmix-prefs.png
+share/gnome/help/gmix/it/figures/gmix.png
+share/gnome/help/gmix/it/gmix-prefs.html
+share/gnome/help/gmix/it/gmix-use.html
+share/gnome/help/gmix/it/gmix.sgml
+share/gnome/help/gmix/it/index.html
+share/gnome/help/gmix/it/license.html
+share/gnome/help/gmix/it/ln10.html
+share/gnome/help/gmix/it/topic.dat
+share/gnome/help/gtcd/C/authors.html
+share/gnome/help/gtcd/C/bugs.html
+share/gnome/help/gtcd/C/figures/gtcd-props.png
+share/gnome/help/gtcd/C/figures/gtcd-window.png
+share/gnome/help/gtcd/C/figures/gtcd.png
+share/gnome/help/gtcd/C/figures/track-number.png
+share/gnome/help/gtcd/C/figures/track-time.png
+share/gnome/help/gtcd/C/figures/trackeditor.png
+share/gnome/help/gtcd/C/gtcd.sgml
+share/gnome/help/gtcd/C/index.html
+share/gnome/help/gtcd/C/license.html
+share/gnome/help/gtcd/C/ln7.html
+share/gnome/help/gtcd/C/topic.dat
+share/gnome/help/gtcd/C/usage.html
+share/gnome/idl/gtcd.idl
share/gnome/mime-info/grecord.keys
share/gnome/mime-info/grecord.mime
+share/gnome/omf/gnome-media/gmix-C.omf
+share/gnome/omf/gnome-media/gmix-it.omf
+share/gnome/omf/gnome-media/gtcd-C.omf
+share/gnome/pixmaps/gnome-grecord.png
share/gnome/pixmaps/gnome-mixer.png
share/gnome/pixmaps/gnome-vumeter.png
share/gnome/pixmaps/gtcd.png
@@ -24,6 +66,7 @@ share/gnome/pixmaps/tcd/play.xpm
share/gnome/pixmaps/tcd/prev_t.xpm
share/gnome/pixmaps/tcd/rw.xpm
share/gnome/pixmaps/tcd/stop.xpm
+share/locale/az/LC_MESSAGES/gnome-media.mo
share/locale/ca/LC_MESSAGES/gnome-media.mo
share/locale/cs/LC_MESSAGES/gnome-media.mo
share/locale/da/LC_MESSAGES/gnome-media.mo
@@ -48,9 +91,23 @@ share/locale/pt/LC_MESSAGES/gnome-media.mo
share/locale/pt_BR/LC_MESSAGES/gnome-media.mo
share/locale/ro/LC_MESSAGES/gnome-media.mo
share/locale/ru/LC_MESSAGES/gnome-media.mo
+share/locale/sk/LC_MESSAGES/gnome-media.mo
+share/locale/sl/LC_MESSAGES/gnome-media.mo
share/locale/sv/LC_MESSAGES/gnome-media.mo
share/locale/tr/LC_MESSAGES/gnome-media.mo
share/locale/uk/LC_MESSAGES/gnome-media.mo
share/locale/zh_CN.GB2312/LC_MESSAGES/gnome-media.mo
share/locale/zh_TW.Big5/LC_MESSAGES/gnome-media.mo
-@dirrm share/gnome/pixmaps/tcd/
+@dirrm share/gnome/pixmaps/tcd
+@dirrm share/gnome/omf/gnome-media
+@dirrm share/gnome/help/gtcd/C/stylesheet-images
+@dirrm share/gnome/help/gtcd/C/figures
+@dirrm share/gnome/help/gtcd/C
+@dirrm share/gnome/help/gtcd
+@dirrm share/gnome/help/gmix/it/stylesheet-images
+@dirrm share/gnome/help/gmix/it/figures
+@dirrm share/gnome/help/gmix/it
+@dirrm share/gnome/help/gmix/C/stylesheet-images
+@dirrm share/gnome/help/gmix/C/figures
+@dirrm share/gnome/help/gmix/C
+@dirrm share/gnome/help/gmix
diff --git a/audio/gnomemedia2/Makefile b/audio/gnomemedia2/Makefile
index 42d4f7abdbc9..cbb0f9b3a05d 100644
--- a/audio/gnomemedia2/Makefile
+++ b/audio/gnomemedia2/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= gnomemedia
-PORTVERSION= 1.2.0
+PORTVERSION= 1.2.3
CATEGORIES= audio gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= stable/sources/gnome-media
diff --git a/audio/gnomemedia2/distinfo b/audio/gnomemedia2/distinfo
index 311191fc2cc0..ece2b633d459 100644
--- a/audio/gnomemedia2/distinfo
+++ b/audio/gnomemedia2/distinfo
@@ -1 +1 @@
-MD5 (gnome-media-1.2.0.tar.gz) = c7cda6054b47f71aa46aaabe9db6fb4c
+MD5 (gnome-media-1.2.3.tar.gz) = bcd99b4fe81141d36bbd40d74a9b448f
diff --git a/audio/gnomemedia2/files/patch-ad b/audio/gnomemedia2/files/patch-ad
index 8c2d1acfb01f..8f4a302b3334 100644
--- a/audio/gnomemedia2/files/patch-ad
+++ b/audio/gnomemedia2/files/patch-ad
@@ -1,24 +1,9 @@
---- gmix/gmix.c.orig Sun Feb 21 12:10:17 1999
-+++ gmix/gmix.c Mon Mar 8 20:41:05 1999
-@@ -94,6 +94,17 @@
- /*
- * All, that is known about a mixer-device
- */
-+
-+#if !defined(OPEN_SOUND_SYSTEM)
-+typedef struct mixer_info
-+{
-+ char id[16];
-+ char name[32];
-+ int modify_counter;
-+ int fillers[10];
-+} mixer_info;
-+#endif
-+
- typedef struct device_info {
- int fd;
- mixer_info info;
-@@ -272,11 +283,7 @@
+
+$FreeBSD$
+
+--- gmix/gmix.c.orig Mon Jun 11 20:50:47 2001
++++ gmix/gmix.c Fri Jul 13 12:45:08 2001
+@@ -499,11 +499,7 @@
/*
* open the mixer-device
*/
@@ -30,9 +15,9 @@
+ sprintf(device_name, "/dev/mixer%i", num);
new_device->fd=open(device_name, O_RDWR, 0);
if (new_device->fd<0) {
- free(new_device);
-@@ -291,6 +298,8 @@
- fprintf(stderr, "Warning: This version of gmix was compiled with a different version of\nsoundcard.h.\n");
+ g_free(new_device);
+@@ -535,6 +531,8 @@
+ }
}
#endif
+
@@ -40,7 +25,7 @@
/*
* mixer-name
*/
-@@ -301,6 +310,11 @@
+@@ -545,6 +543,11 @@
}
if(!isalpha(new_device->info.name[0]))
g_snprintf(new_device->info.name, 31, "Card %d", num+1);
@@ -52,7 +37,7 @@
/*
* several bitmasks describing the mixer
*/
-@@ -386,15 +400,16 @@
+@@ -677,15 +680,16 @@
{
int cnt;
device_info *new_device;
@@ -71,4 +56,4 @@
+ || new_device);
}
- void free_one_device(gpointer a, gpointer b)
+ #ifdef ALSA
diff --git a/audio/gnomemedia2/files/patch-ae b/audio/gnomemedia2/files/patch-ae
index b2878eb5521b..53c2143d301b 100644
--- a/audio/gnomemedia2/files/patch-ae
+++ b/audio/gnomemedia2/files/patch-ae
@@ -1,789 +1,23 @@
---- tcd/callbacks.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/callbacks.c Tue May 30 15:17:17 2000
-@@ -12,3 +12,3 @@
- {
+
+$FreeBSD$
+
+--- tcd/callbacks.c 2001/07/13 07:48:12 1.1
++++ tcd/callbacks.c 2001/07/13 07:50:36
+@@ -13,7 +13,7 @@
+ {
+ if(!cd.isplayable)
+ return;
- if(cd.sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
+ if(SC_AUDIOSTATUS(cd.sc)==CDROM_AUDIO_PAUSED)
tcd_pausecd(&cd);
-@@ -44,3 +44,3 @@
+ else
+ tcd_playtracks(&cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -45,7 +45,7 @@
+ cd.play_method = NORMAL;
+ cd.repeat_track = -1;
/* SDH: Make sure play/pause state change is noticed */
- cd.sc.cdsc_audiostatus = -1;
+ SC_AUDIOSTATUS(cd.sc) = -1;
if(cd.isplayable)
---- tcd/cddb.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/cddb.c Tue May 30 15:17:17 2000
-@@ -201,7 +201,7 @@
-
-- min = cd->trk[trk].toc.cdte_addr.msf.minute;
-- sec = cd->trk[trk].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[trk]);
-+ sec = TOC_SECOND(cd->trk[trk]);
-
- n = (min*60)+sec;
-- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
-+ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
- }
-@@ -209,4 +209,4 @@
- fprintf( fp, "#\n# Disc length: %i seconds\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
-
-@@ -247,6 +247,6 @@
-
-- min = cd->trk[i].toc.cdte_addr.msf.minute;
-- sec = cd->trk[i].toc.cdte_addr.msf.second;
-+ min = TOC_MINUTE(cd->trk[i]);
-+ sec = TOC_SECOND(cd->trk[i]);
-
-- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
-+ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
-
-@@ -259,4 +259,4 @@
- l=sprintf( tmp, "%i\n",
-- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
-- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
-+ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
-+ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
- if(blen>l)
-@@ -300,5 +300,5 @@
- {
-- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
-- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
-- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
-+ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
-+ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
-+ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
- }
---- tcd/gtcd.c.orig Sun May 21 15:13:04 2000
-+++ tcd/gtcd.c Tue May 30 15:17:17 2000
-@@ -157,3 +157,7 @@
- cd.time_lock = TRUE;
-+#ifdef TCD_BSD
-+ ioctl(cd.cd_dev, CDIOCPAUSE);
-+#else
- ioctl(cd.cd_dev, CDROMPAUSE);
-+#endif
-
-@@ -421,4 +425,4 @@
- cur = cd.cur_pos_abs;
-- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
-- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
-+ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
-+ +TOC_SECOND(cd.trk[cd.last_t+1]));
- pos = end-cur;
-@@ -524,3 +528,3 @@
- {
-- switch( cd.sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd.sc) )
- {
-@@ -620,4 +624,4 @@
- /* see if we need to repeat */
-- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -638,3 +642,3 @@
- {
-- if(old_status != cd.sc.cdsc_audiostatus)
-+ if(old_status != SC_AUDIOSTATUS(cd.sc))
- {
-@@ -645,3 +649,3 @@
-
-- old_status = cd.sc.cdsc_audiostatus;
-+ old_status = SC_AUDIOSTATUS(cd.sc);
- g_snprintf(tmp, 255, "tcd/%s.xpm",
---- tcd/gtracked.c.orig Sun May 21 15:13:05 2000
-+++ tcd/gtracked.c Tue May 30 15:17:17 2000
-@@ -211,4 +211,4 @@
- g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
-- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
-+ TOC_MINUTE(cd.trk[cd.last_t+1]),
-+ TOC_SECOND(cd.trk[cd.last_t+1]));
-
---- tcd/linux-cdrom.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.c Tue May 30 15:29:32 2000
-@@ -73,3 +73,3 @@
-
--#if defined(TCD_CHANGER_ENABLED)
-+#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
- cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
-@@ -116,4 +116,7 @@
- {
-- int tmp,i;
-+ int i;
- int delsecs;
-+#ifdef TCD_BSD
-+ struct ioc_read_toc_single_entry tocentry;
-+#endif
-
-@@ -127,3 +130,7 @@
- /* read the TOC header */
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
-+#else
- if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
-+#endif
- {
-@@ -134,2 +141,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -138,11 +148,25 @@
- /* grab first & last tracks */
-+#ifdef TCD_BSD
-+ cd->first_t = cd->tochdr.starting_track;
-+ cd->last_t = cd->tochdr.ending_track;
-+#else
- cd->first_t = cd->tochdr.cdth_trk0;
- cd->last_t = cd->tochdr.cdth_trk1;
-+#endif
-
- /* read the leadout track */
-+#ifdef TCD_BSD
-+ tocentry.track = 0xaa; /* Magic last track */
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
- cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
-+#endif
-
- /* read the leadout toc */
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
-+#endif
- {
-@@ -154,4 +178,15 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-- }
-+ }
-+
-+#ifdef TCD_BSD
-+ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
-+#endif
-+ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
-+ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
-
-@@ -160,6 +195,15 @@
- {
-+#ifdef TCD_BSD
-+ tocentry.track = i;
-+ tocentry.address_format = CD_MSF_FORMAT;
-+#else
- cd->trk[C(i)].toc.cdte_track = i;
- cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
-+#endif
-
-+#ifdef TCD_BSD
-+ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
-+#else
- if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
-+#endif
- {
-@@ -170,2 +214,5 @@
- cd->cddb_id = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -173,7 +220,12 @@
-
-+#ifdef TCD_BSD
-+ cd->trk[C(i)].toc = tocentry.entry;
-+ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
-+#else
- cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
-- cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
-- cd->trk[C(i)].toc.cdte_addr.msf.second;
-+#endif
-+ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
-+ TOC_SECOND(cd->trk[C(i)]);
- cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
-- cd->trk[C(i)].toc.cdte_addr.msf.frame;
-+ TOC_FRAME(cd->trk[C(i)]);
- }
-@@ -184,6 +236,3 @@
- /* Taken from cdtool...Thanks Thomas I.! */
-- delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
-- + cd->trk[C(i+1)].toc.cdte_addr.msf.second
-- - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
-- - cd->trk[C(i)].toc.cdte_addr.msf.second;
-+ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
-
-@@ -206,3 +255,3 @@
- debug("cdrom.c: tcd_readtoc exiting normally\n" );
-- return tmp;
-+ return 0;
- }
-@@ -216,5 +265,4 @@
- /* calculate various timing values */
-- cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
-- cd->sc.cdsc_absaddr.msf.second;
-- cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
-+ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
-+ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
-
-@@ -237,4 +285,6 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
- #endif
-+#endif
- }
-@@ -284,4 +334,16 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_read_subchannel subch;
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ subch.address_format = CD_MSF_FORMAT;
-+ subch.data_format = CD_CURRENT_POSITION;
-+ subch.data_len = sizeof(cd->sc);
-+ subch.track = 0;
-+ subch.data = &(cd->sc);
-+#else
- cd->sc.cdsc_format = CDROM_MSF;
-+#endif
-
-@@ -289,3 +351,7 @@
- {
-+#ifdef TCD_BSD
-+ if((ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch)) == -1)
-+#else
- if(ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc))
-+#endif
- {
-@@ -295,8 +361,21 @@
- cd->cur_t = 0;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return;
- }
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
-- cd->cur_t = cd->sc.cdsc_trk;
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-+ cd->cur_t = SC_TRACK(cd->sc);
-+ }
- else
-+ {
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- cd->cur_t = 0;
-+ }
- tcd_recalculate(cd);
-@@ -307,8 +386,21 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+#else
- struct cdrom_volctrl vol;
-+#endif
-
-+#ifdef TCD_BSD
-+ vol.vol[0] = volume;
-+ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
-+#else
- vol.channel0 = volume;
- vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
--
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSETVOL, &vol) < 0)
-+#else
- if(ioctl(cd->cd_dev, CDROMVOLCTRL, &vol) < 0)
-+#endif
- return FALSE;
-@@ -320,2 +412,10 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_vol vol;
-+
-+ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
-+ return -1;
-+
-+ return vol.vol[0];
-+#else
- #ifdef CDROMVOLREAD
-@@ -330,2 +430,3 @@
- #endif
-+#endif
- }
-@@ -334,4 +435,30 @@
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#define MSF_START_MIN (msf.start_m)
-+#define MSF_START_SEC (msf.start_s)
-+#define MSF_START_FRM (msf.start_f)
-+#define MSF_END_MIN (msf.end_m)
-+#define MSF_END_SEC (msf.end_s)
-+#define MSF_END_FRM (msf.end_f)
-+ struct ioc_play_track trkind;
-+#define TI_START_TRK (trkind.start_track)
-+#define TI_START_IND (trkind.start_index)
-+#define TI_END_TRK (trkind.end_track)
-+#define TI_END_IND (trkind.end_index)
-+#else
- struct cdrom_msf msf;
-+#define MSF_START_MIN (msf.cdmsf_min0)
-+#define MSF_START_SEC (msf.cdmsf_sec0)
-+#define MSF_START_FRM (msf.cdmsf_frame0)
-+#define MSF_END_MIN (msf.cdmsf_min1)
-+#define MSF_END_SEC (msf.cdmsf_sec1)
-+#define MSF_END_FRM (msf.cdmsf_frame0)
- struct cdrom_ti trkind;
-+#define TI_START_TRK (trkind.cdti_trk0)
-+#define TI_START_IND (trkind.cdti_ind0)
-+#define TI_END_TRK (trkind.cdti_trk1)
-+#define TI_END_IND (trkind.cdti_ind1)
-+#endif
-+
- int tmp;
-@@ -344,3 +471,3 @@
- {
-- /* try and inject cd */
-+ /* try and eject cd */
- tcd_ejectcd(cd);
-@@ -354,2 +481,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl(cd->cd_dev, CDIOCCLOSE);
-+#else
- #if defined(CDROMCLOSETRAY)
-@@ -358,9 +488,15 @@
- #endif
--
-+#endif
-+
-+ /* bad hack. most data tracks are the first track... */
-+#ifdef TCD_BSD
-+ if(cd->trk[start_t].toc.control == 0x04)
-+#else
- if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
-- start_t++; /* bad hack. most data tracks are the first track... */
-+#endif
-+ start_t++;
-
-- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
-+ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
-+ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
-+ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
-
-@@ -368,5 +504,5 @@
- {
-- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
-- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
-- msf.cdmsf_frame1=0;
-+ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
-+ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
-+ MSF_END_FRM = 0;
- }
-@@ -374,20 +510,20 @@
- {
-- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame - 1;
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if(MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
-@@ -395,6 +531,11 @@
- }
-- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
-- msf.cdmsf_sec1 %= 60;
-+ MSF_END_MIN += (MSF_END_SEC / 60);
-+ MSF_END_SEC %= 60;
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
-+#endif
- {
-@@ -403,8 +544,12 @@
- /* Try alternate method of playing */
-- trkind.cdti_trk0 = start_t; /* start track */
-- trkind.cdti_ind0 = 0; /* start index */
-- trkind.cdti_trk1 = end_t; /* end track */
-- trkind.cdti_ind1 = 0; /* end index */
-+ TI_START_TRK = start_t; /* start track */
-+ TI_START_IND = 0; /* start index */
-+ TI_END_TRK = end_t; /* end track */
-+ TI_END_IND = 0; /* end index */
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
-+#endif
- {
-@@ -413,2 +558,5 @@
- debug("cdrom.c: tcd_playtracks error. CDROMPLAYTRKIND ioctl error.\n");
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return -1;
-@@ -422,21 +570,10 @@
-
--static int msf_2_frame( cd_min_sec_frame *msf )
--{
-- return( ( msf->minute * CD_SECS + msf->second )
-- * CD_FRAMES + msf->frame );
--}
--
--static void frame_2_msf( int frame, cd_min_sec_frame *msf )
--{
-- msf->frame = frame % CD_FRAMES;
-- frame /= CD_FRAMES;
-- msf->second = frame % CD_SECS;
-- msf->minute = frame / CD_SECS;
--}
--
- int tcd_play_seconds( cd_struct *cd, long int offset )
- {
-+#ifdef TCD_BSD
-+ struct ioc_play_msf msf;
-+#else
- struct cdrom_msf msf;
-- cd_min_sec_frame msf0;
-- int cur_frame, start_frame, end_frame;
-+#endif
-+ int tmp;
-
-@@ -447,41 +584,42 @@
-
-- /* converting msf to frames makes life much easier */
-- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
-- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
-- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
--
-- /* keep the cur_frame within the boundaries of the first and last track */
-- if ( cur_frame < start_frame ) {
-- cur_frame = start_frame;
-- } else if ( cur_frame > end_frame ) {
-- cur_frame = end_frame;
-- }
--
-- /* convert frames back to msf */
-- frame_2_msf( cur_frame, &msf0 );
-- msf.cdmsf_min0 = msf0.minute;
-- msf.cdmsf_sec0 = msf0.second;
-- msf.cdmsf_frame0 = msf0.frame;
-- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
-- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
-- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame - 1;
-+ /* got subchannel? */
-+ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
-+ MSF_START_MIN = SC_MINUTE(cd->sc);
-+ MSF_START_FRM = SC_FRAME(cd->sc);
-+ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
-+ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]) - 1;
-
- #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
-- if(msf.cdmsf_frame1 < 0)
-+ if((MSF_END_FRM < 0)
- {
-- msf.cdmsf_sec1 += msf.cdmsf_frame1;
-- msf.cdmsf_frame1 = 0;
-+ MSF_END_SEC += MSF_END_FRM;
-+ MSF_END_FRM = 0;
- }
-- if(msf.cdmsf_sec1 < 0)
-+ if(MSF_END_SEC < 0)
- {
-- msf.cdmsf_min1 += msf.cdmsf_sec1;
-- msf.cdmsf_sec1 = 0;
-+ MSF_END_MIN += MSF_END_SEC;
-+ MSF_END_SEC = 0;
- }
-- if(msf.cdmsf_min1 < 0)
-+ if(MSF_END_MIN < 0)
- {
-- msf.cdmsf_min1 = 0;
-+ MSF_END_MIN = 0;
- }
- #endif
-+
-+ if(MSF_START_SEC > 60 && (offset<0))
-+ {
-+ MSF_START_SEC = 60-abs(offset);
-+ MSF_START_MIN--;
-+ }
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT );
-+#endif
-
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf))
-+#else
- if(ioctl(cd->cd_dev, CDROMPLAYMSF, &msf))
-+#endif
- {
-@@ -491,2 +629,5 @@
- debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW );
-+#endif
- return(-1);
-@@ -507,3 +648,11 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
-+#ifdef TCD_BSD
-+ if(!ioctl(cd->cd_dev, CDIOCEJECT))
-+#else
- if(!ioctl(cd->cd_dev, CDROMEJECT))
-+#endif
- {
-@@ -515,2 +664,5 @@
- {
-+#ifdef TCD_BSD
-+ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
-+#else
- #ifdef CDROMCLOSETRAY
-@@ -518,2 +670,7 @@
- #endif
-+#endif
-+
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
-
-@@ -527,2 +684,5 @@
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
-@@ -544,7 +704,15 @@
- /* SDH: Makes things cleaner on eject */
-- if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
-+
- cd->err = FALSE;
-+#ifdef TCD_BSD
-+ if(ioctl(cd->cd_dev, CDIOCSTOP))
-+#else
- if(ioctl(cd->cd_dev, CDROMSTOP))
-+#endif
- {
-@@ -566,5 +734,9 @@
-
-- if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
-- {
-+ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
-+ {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCRESUME)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMRESUME)))
-+#endif
- {
-@@ -572,4 +744,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -578,3 +756,7 @@
- {
-+#ifdef TCD_BSD
-+ if((tmp=ioctl(cd->cd_dev, CDIOCPAUSE)))
-+#else
- if((tmp=ioctl(cd->cd_dev, CDROMPAUSE)))
-+#endif
- {
-@@ -582,4 +764,10 @@
- cd->err = TRUE;
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCALLOW);
-+#endif
- return(-1);
- }
-+#ifdef TCD_BSD
-+ ioctl( cd->cd_dev, CDIOCPREVENT);
-+#endif
- return tmp;
-@@ -591,2 +779,3 @@
- #ifdef TCD_CHANGER_ENABLED
-+#ifndef TCD_BSD
- int tmp;
-@@ -599,6 +788,6 @@
- return tmp;
--#else
-+#endif
-+#endif
- debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
- return 0;
--#endif
- }
---- tcd/linux-cdrom.h.orig Thu Jan 13 22:27:52 2000
-+++ tcd/linux-cdrom.h Tue May 30 15:34:32 2000
-@@ -29,4 +29,16 @@
- #include <glib.h>
--#if !defined(linux) && !defined(sun) && !defined(__sun__)
--# error TCD only builds on linux and Solaris/SunOs
-+#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
-+# error TCD only builds on Linux, Solaris, SunOS, and FreeBSD
-+#endif
-+
-+#ifdef __FreeBSD__
-+#define TCD_BSD
-+#include <sys/cdio.h>
-+#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
-+#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
-+#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
-+#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
-+#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
-+#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
-+#define CDROM
- #endif
-@@ -128,3 +140,13 @@
- char extd[EXT_DATA_LEN+1]; /* extra information for this track */
-+#ifdef TCD_BSD
-+ struct cd_toc_entry toc;
-+#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
-+#else
- struct cdrom_tocentry toc;
-+#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
-+#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
-+#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
-+#endif
- int titled;
-@@ -154,2 +176,14 @@
-
-+#ifdef TCD_BSD
-+ /* See /usr/include/sys/cdio.h */
-+ struct ioc_play_track ti;
-+ struct ioc_toc_header tochdr;
-+ struct cd_sub_channel_info sc;
-+#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
-+#define SC_TRACK(sc) (sc.what.position.track_number)
-+#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
-+#else
-+
- /* See /usr/src/linux/include/linux/cdrom.h */
-@@ -158,2 +192,8 @@
- struct cdrom_subchnl sc; /* Subchannel, for time */
-+#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
-+#define SC_TRACK(sc) (sc.cdsc_trk)
-+#define SC_MINUTE(sc) (sc.cdsc_absaddr.msf.minute)
-+#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
-+#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
-+#endif
- int volume; /* Must range 0-100 */
---- tcd/tcd.c.orig Thu Jan 13 22:27:52 2000
-+++ tcd/tcd.c Tue May 30 15:17:17 2000
-@@ -141,4 +141,4 @@
- stopped anyway, fix it. */
-- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
-- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
-+ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
- {
-@@ -172,3 +172,3 @@
- if(cd->isplayable) {
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
- tcd_pausecd(cd);
-@@ -442,4 +442,4 @@
- mvwprintw(win,maxy-4,38,"%02u:%02u",
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
-- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
-+ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
-+ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
- mvwprintw(win,maxy-3,38,cd->dtitle );
-@@ -480,3 +480,3 @@
- {
-- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
-+ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
- stat = 'P';
-@@ -484,3 +484,7 @@
- stat = 'R';
-+#if defined(TCD_BSD)
-+ else if(cd->trk[i].toc.control == 0x04)
-+#else
- else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
-+#endif
- stat = 'd';
-@@ -500,3 +504,3 @@
-
-- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
-+ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
- attron( A_BOLD );
-@@ -507,3 +511,3 @@
-
-- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
-+ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
- attroff( A_BOLD );
-@@ -518,3 +522,3 @@
{
-- switch( cd->sc.cdsc_audiostatus )
-+ switch( SC_AUDIOSTATUS(cd->sc) )
- {
+ make_goto_menu();
diff --git a/audio/gnomemedia2/files/patch-gmix::gmix.h b/audio/gnomemedia2/files/patch-gmix::gmix.h
new file mode 100644
index 000000000000..7718b6cd4dba
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-gmix::gmix.h
@@ -0,0 +1,22 @@
+
+$FreeBSD$
+
+--- gmix/gmix.h 2001/07/13 09:44:04 1.1
++++ gmix/gmix.h 2001/07/13 09:44:44
+@@ -39,6 +39,16 @@
+ /*
+ * All, that is known about a mixer-device
+ */
++#if !defined(OPEN_SOUND_SYSTEM)
++typedef struct mixer_info
++{
++ char id[16];
++ char name[32];
++ int modify_counter;
++ int fillers[10];
++} mixer_info;
++#endif
++
+ typedef struct device_info {
+ #ifdef ALSA
+ snd_mixer_t *handle;
diff --git a/audio/gnomemedia2/files/patch-tcd::cddb.c b/audio/gnomemedia2/files/patch-tcd::cddb.c
new file mode 100644
index 000000000000..841fc4c6ba13
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::cddb.c
@@ -0,0 +1,65 @@
+
+$FreeBSD$
+
+--- tcd/cddb.c 2001/07/13 07:50:57 1.1
++++ tcd/cddb.c 2001/07/13 07:55:41
+@@ -199,16 +199,16 @@
+ {
+ int min, sec;
+
+- min = cd->trk[trk].toc.cdte_addr.msf.minute;
+- sec = cd->trk[trk].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[trk]);
++ sec = TOC_SECOND(cd->trk[trk]);
+
+ n = (min*60)+sec;
+- fprintf( fp, "# %u\n", (n*75)+cd->trk[trk].toc.cdte_addr.msf.frame );
++ fprintf( fp, "# %u\n", (n*75)+TOC_FRAME(cd->trk[trk]) );
+ }
+ /* Print the number of seconds */
+ fprintf( fp, "#\n# Disc length: %i seconds\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+
+ fprintf( fp, "#\n# Revision: %lu\n", cd->cddb_rev );
+ fprintf( fp, "# Submitted via: tcd 2.0b\n" );
+@@ -245,10 +245,10 @@
+ {
+ int min, sec;
+
+- min = cd->trk[i].toc.cdte_addr.msf.minute;
+- sec = cd->trk[i].toc.cdte_addr.msf.second;
++ min = TOC_MINUTE(cd->trk[i]);
++ sec = TOC_SECOND(cd->trk[i]);
+
+- l=sprintf( tmp, "%u ", calc_offset(min,sec,cd->trk[i].toc.cdte_addr.msf.frame));
++ l=sprintf( tmp, "%u ", calc_offset(min,sec,TOC_FRAME(cd->trk[i])));
+
+ if(blen>l)
+ {
+@@ -257,8 +257,8 @@
+ }
+ }
+ l=sprintf( tmp, "%i\n",
+- (cd->trk[cd->last_t+1].toc.cdte_addr.msf.minute*60)
+- +(cd->trk[cd->last_t+1].toc.cdte_addr.msf.second) );
++ (TOC_MINUTE(cd->trk[cd->last_t+1])*60)
++ +(TOC_SECOND(cd->trk[cd->last_t+1])) );
+ if(blen>l)
+ strcat( buf,tmp );
+
+@@ -298,9 +298,9 @@
+
+ for( i=0; i <= cd->last_t+1; i++ )
+ {
+- cdtoc[i].frame = cd->trk[i+1].toc.cdte_addr.msf.frame;
+- cdtoc[i].min = cd->trk[i+1].toc.cdte_addr.msf.minute;
+- cdtoc[i].sec = cd->trk[i+1].toc.cdte_addr.msf.second;
++ cdtoc[i].frame = TOC_FRAME(cd->trk[i+1]);
++ cdtoc[i].min = TOC_MINUTE(cd->trk[i+1]);
++ cdtoc[i].sec = TOC_SECOND(cd->trk[i+1]);
+ }
+
+
diff --git a/audio/gnomemedia2/files/patch-tcd::gtcd.c b/audio/gnomemedia2/files/patch-tcd::gtcd.c
new file mode 100644
index 000000000000..b7ad854ee209
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::gtcd.c
@@ -0,0 +1,100 @@
+
+$FreeBSD$
+
+--- tcd/gtcd.c.orig Mon Jun 11 20:50:57 2001
++++ tcd/gtcd.c Fri Jul 13 12:49:33 2001
+@@ -163,7 +163,11 @@
+ gint release_timer(gpointer *data)
+ {
+ cd.time_lock = TRUE;
++#ifdef TCD_BSD
++ ioctl(cd.cd_dev, CDIOCPAUSE);
++#else
+ ioctl(cd.cd_dev, CDROMPAUSE);
++#endif
+
+ roll_t = gtk_timeout_add(40, (GtkFunction)roll_timer, data);
+ release_t = 0;
+@@ -206,7 +210,11 @@
+ if(GPOINTER_TO_INT(data) > 0)
+ {
+ if((cd.cur_t < cd.last_t) &&
++#ifdef TCD_BSD
++ cd.trk[cd.cur_t+1].toc.control == 0x04)
++#else
+ (cd.trk[cd.cur_t+1].toc.cdte_ctrl != CDROM_DATA_TRACK))
++#endif
+ {
+ cd.cur_t++;
+ tcd_playtracks(&cd,cd.cur_t, cd.last_t, prefs->only_use_trkind);
+@@ -541,8 +549,8 @@
+ break;
+ case TRACK_R: /* track time decending */
+ cur = cd.cur_pos_rel;
+- end = (cd.trk[cd.cur_t].tot_min*60)+
+- cd.trk[cd.cur_t].tot_sec;
++ end = (TOC_MINUTE(cd.trk[cd.cur_t])*60)+
++ TOC_SECOND(cd.trk[cd.cur_t]);
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -555,8 +563,8 @@
+ break;
+ case DISC_R:
+ cur = cd.cur_pos_abs;
+- end = (cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute
+- *60)+cd.trk[cd.last_t+1].toc.cdte_addr.msf.second;
++ end = (TOC_MINUTE(cd.trk[cd.last_t+1])*60
++ +TOC_SECOND(cd.trk[cd.last_t+1]));
+ pos = end-cur;
+ min = pos/60;
+ sec = pos-(pos/60)*60;
+@@ -660,7 +668,7 @@
+
+ if( !cd.err )
+ {
+- switch( cd.sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd.sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy(tmp, _("No Disc"));
+@@ -756,8 +764,8 @@
+ }
+
+ /* see if we need to repeat */
+- if( cd.sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd.sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd.sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd.play_method == REPEAT_CD )
+ tcd_playtracks( &cd, cd.first_t, cd.last_t, prefs->only_use_trkind);
+@@ -774,14 +782,14 @@
+
+ void status_changed(void)
+ {
+- if(old_status != cd.sc.cdsc_audiostatus)
++ if(old_status != SC_AUDIOSTATUS(cd.sc))
+ {
+ GtkWidget *pixmap;
+ GtkSignalFunc func;
+ char tmp[256];
+ char *name;
+
+- old_status = cd.sc.cdsc_audiostatus;
++ old_status = SC_AUDIOSTATUS(cd.sc);
+ g_snprintf(tmp, 255, "tcd/%s.xpm",
+ (old_status==CDROM_AUDIO_PLAY)?"pause":"play");
+
+@@ -846,7 +854,11 @@
+
+ for(i=1; i <= cd.last_t; i++)
+ {
++#ifdef TCD_BSD
++ data_track = (cd.trk[C(i)].toc.control == 0x04);
++#else
+ data_track = (cd.trk[C(i)].toc.cdte_ctrl == CDROM_DATA_TRACK);
++#endif
+
+ g_snprintf(buf, TRK_NAME_LEN, "%2d - %s", i,
+ data_track ? "[Data]" : cd.trk[C(i)].name);
diff --git a/audio/gnomemedia2/files/patch-tcd::gtracked.c b/audio/gnomemedia2/files/patch-tcd::gtracked.c
new file mode 100644
index 000000000000..2fa7e62458b1
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::gtracked.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- tcd/gtracked.c 2001/07/13 08:05:56 1.1
++++ tcd/gtracked.c 2001/07/13 08:06:50
+@@ -211,8 +211,8 @@
+
+ /* Disc area */
+ g_snprintf(tmp, 63, _("Disc Information (%02u:%02u minutes)"),
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.minute,
+- cd.trk[cd.last_t+1].toc.cdte_addr.msf.second);
++ TOC_MINUTE(cd.trk[cd.last_t+1]),
++ TOC_SECOND(cd.trk[cd.last_t+1]));
+
+ disc_frame = gtk_frame_new(tmp);
+ disc_vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
diff --git a/audio/gnomemedia2/files/patch-tcd::linux-cdrom.c b/audio/gnomemedia2/files/patch-tcd::linux-cdrom.c
new file mode 100644
index 000000000000..b09f2eaa0f64
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::linux-cdrom.c
@@ -0,0 +1,667 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.c.orig Mon Jun 11 20:50:58 2001
++++ tcd/linux-cdrom.c Fri Jul 13 12:52:22 2001
+@@ -67,6 +67,7 @@
+ return;
+ }
+
++#ifndef TCD_BSD
+ static void decrement_msf_end_by_one (struct cdrom_msf *msf)
+ {
+ if (msf->cdmsf_frame1)
+@@ -87,13 +88,14 @@
+ }
+ }
+ }
++#endif
+
+ int tcd_init_disc( cd_struct *cd, WarnFunc msg_cb )
+ {
+ debug("cdrom.c: tcd_init_disc(%p) top\n", cd );
+ tcd_opencddev( cd, msg_cb );
+
+-#if defined(TCD_CHANGER_ENABLED)
++#if defined(TCD_CHANGER_ENABLED) && !defined(TCD_BSD)
+ cd->nslots = ioctl( cd->cd_dev, CDROM_CHANGER_NSLOTS );
+ #else
+ cd->nslots = 0;
+@@ -131,6 +133,9 @@
+ int tcd_close_disc( cd_struct *cd )
+ {
+ debug("cdrom.c: tcd_close_disc(%p) top\n", cd );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ close(cd->cd_dev);
+ cd->cd_dev = -1;
+ debug("cdrom.c: tcd_close_disc exiting normally\n" );
+@@ -141,6 +146,10 @@
+ {
+ int i;
+ int delsecs;
++#ifdef TCD_BSD
++ struct ioc_read_toc_single_entry tocentry;
++#endif
++
+
+ if(cd->time_lock)
+ return;
+@@ -152,7 +161,11 @@
+ cd->isplayable=FALSE;
+
+ /* read the TOC header */
++#ifdef TCD_BSD
++ if((ioctl( cd->cd_dev, CDIOREADTOCHEADER, &cd->tochdr))==-1)
++#else
+ if(ioctl( cd->cd_dev, CDROMREADTOCHDR, &cd->tochdr))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -164,15 +177,29 @@
+ }
+
+ /* grab first & last tracks */
++#ifdef TCD_BSD
++ cd->first_t = cd->tochdr.starting_track;
++ cd->last_t = cd->tochdr.ending_track;
++#else
+ cd->first_t = cd->tochdr.cdth_trk0;
+ cd->last_t = cd->tochdr.cdth_trk1;
++#endif
+
+ /* read the leadout track */
++#ifdef TCD_BSD
++ tocentry.track = 0xaa; /* Magic last track */
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(cd->last_t+1)].toc.cdte_track = CDROM_LEADOUT;
+ cd->trk[C(cd->last_t+1)].toc.cdte_format = CDROM_MSF;
++#endif
+
+ /* read the leadout toc */
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(cd->last_t+1)].toc))
++#endif
+ {
+ strcpy(cd->errmsg, "Can't read disc.");
+ cd->err = TRUE;
+@@ -184,13 +211,30 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(cd->last_t+1)].toc = tocentry.entry;
++ cd->trk[C(cd->last_t+1)].length = TOC_MINUTE(cd->trk[C(cd->last_t+1)]) * 60 +
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ cd->trk[C(cd->last_t+1)].start = cd->trk[C(cd->last_t+1)].length * 75 +
++ TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++#endif
++
+ /* read the rest of the tocs */
+ for( i = cd->first_t; i <= cd->last_t; i++ )
+ {
++#ifdef TCD_BSD
++ tocentry.track = i;
++ tocentry.address_format = CD_MSF_FORMAT;
++#else
+ cd->trk[C(i)].toc.cdte_track = i;
+ cd->trk[C(i)].toc.cdte_format = CDROM_MSF;
++#endif
+
++#ifdef TCD_BSD
++ if((ioctl(cd->cd_dev, CDIOREADTOCENTRY, &tocentry)) == -1)
++#else
+ if(ioctl(cd->cd_dev, CDROMREADTOCENTRY, &cd->trk[C(i)].toc))
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -201,21 +245,34 @@
+ return;
+ }
+
++#ifdef TCD_BSD
++ cd->trk[C(i)].toc = tocentry.entry;
++ cd->trk[C(i)].type = cd->trk[C(i)].toc.control;
++ cd->trk[C(i)].length = TOC_MINUTE(cd->trk[C(i)]) * 60 +
++ TOC_SECOND(cd->trk[C(i)]);
++ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
++ TOC_FRAME(cd->trk[C(i)]);
++#else
+ cd->trk[C(i)].type = cd->trk[C(i)].toc.cdte_ctrl;
+ cd->trk[C(i)].length = cd->trk[C(i)].toc.cdte_addr.msf.minute * 60 +
+ cd->trk[C(i)].toc.cdte_addr.msf.second;
+ cd->trk[C(i)].start = cd->trk[C(i)].length * 75 +
+ cd->trk[C(i)].toc.cdte_addr.msf.frame;
++#endif
+ }
+
+ /* calculate track times */
+ for(i = cd->first_t; i <= cd->last_t; i ++)
+ {
+ /* Taken from cdtool...Thanks Thomas I.! */
++#ifdef TCD_BSD
++ delsecs = cd->trk[C(i+1)].length - cd->trk[C(i)].length;
++#else
+ delsecs = cd->trk[C(i+1)].toc.cdte_addr.msf.minute * 60
+ + cd->trk[C(i+1)].toc.cdte_addr.msf.second
+ - cd->trk[C(i)].toc.cdte_addr.msf.minute * 60
+ - cd->trk[C(i)].toc.cdte_addr.msf.second;
++#endif
+
+ cd->trk[C(i)].tot_min = delsecs / 60;
+ cd->trk[C(i)].tot_sec = delsecs - (delsecs/60)*60;
+@@ -245,9 +302,14 @@
+ return;
+
+ /* calculate various timing values */
++#ifdef TCD_BSD
++ cd->cur_pos_abs = SC_MINUTE(cd->sc) * 60 + SC_SECOND(cd->sc);
++ cd->cur_frame = cd->cur_pos_abs * 75 + SC_FRAME(cd->sc);
++#else
+ cd->cur_pos_abs = cd->sc.cdsc_absaddr.msf.minute * 60 +
+ cd->sc.cdsc_absaddr.msf.second;
+ cd->cur_frame = cd->cur_pos_abs * 75 + cd->sc.cdsc_absaddr.msf.frame;
++#endif
+
+ cd->cur_pos_rel = (cd->cur_frame - cd->trk[C(cd->cur_t)].start) / 75;
+
+@@ -266,10 +328,12 @@
+ cd->cd_min = cd->cur_pos_abs / 60;
+
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ tcd_opencddev( cd, NULL );
+ cd->cur_disc = ioctl( cd->cd_dev, CDROM_SELECT_DISC, CDSL_CURRENT );
+ tcd_close_disc ( cd );
+ #endif
++#endif
+ }
+
+ void tcd_recalculate_fake(cd_struct *cd, gint abs_pos, gint track)
+@@ -305,7 +369,11 @@
+
+ for(t = cd->first_t; t <= cd->last_t; t++)
+ {
++#ifdef TCD_BSD
++ if(cd->trk[t].toc.control == 0x04)
++#else
+ if(cd->trk[t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ return t-1;
+ if(abs_pos >= cd->trk[t].start/75)
+ continue;
+@@ -316,16 +384,35 @@
+
+ void tcd_gettime( cd_struct *cd )
+ {
++#ifdef TCD_BSD
++ struct ioc_read_subchannel subch;
++#endif
+ cd->err = FALSE;
++#ifdef TCD_BSD
++ subch.address_format = CD_MSF_FORMAT;
++ subch.data_format = CD_CURRENT_POSITION;
++ subch.data_len = sizeof(cd->sc);
++ subch.track = 0;
++ subch.data = &(cd->sc);
++#else
+ cd->sc.cdsc_format = CDROM_MSF;
++#endif
+
+ if(cd->isplayable)
+ {
+ int tmp;
+ tcd_opencddev (cd, NULL);
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCREADSUBCHANNEL, &subch);
++#else
+ tmp = ioctl( cd->cd_dev, CDROMSUBCHNL, &cd->sc);
++#endif
+ tcd_close_disc (cd);
++#ifdef TCD_BSD
++ if(tmp == -1)
++#else
+ if(tmp)
++#endif
+ {
+ strcpy( cd->errmsg, "Can't read disc." );
+ cd->err = TRUE;
+@@ -333,8 +420,18 @@
+ cd->cur_t = 0;
+ return;
+ }
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PLAY )
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PLAY)
++#endif
++ {
++#ifdef TCD_BSD
++ cd->cur_t = SC_TRACK(cd->sc);
++#else
+ cd->cur_t = cd->sc.cdsc_trk;
++#endif
++ }
+ else
+ cd->cur_t = 0;
+ tcd_recalculate(cd);
+@@ -343,14 +440,27 @@
+
+ int tcd_set_volume(cd_struct *cd, int volume)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++#else
+ struct cdrom_volctrl vol;
++#endif
+ int tmp;
+
++#ifdef TCD_BSD
++ vol.vol[0] = volume;
++ vol.vol[1] = vol.vol[2] = vol.vol[3] = vol.vol[0];
++#else
+ vol.channel0 = volume;
+ vol.channel1 = vol.channel2 = vol.channel3 = vol.channel0;
++#endif
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ tmp = ioctl(cd->cd_dev, CDIOCSETVOL, &vol);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMVOLCTRL, &vol);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp < 0)
+ return FALSE;
+@@ -360,6 +470,14 @@
+
+ int tcd_get_volume(cd_struct *cd)
+ {
++#ifdef TCD_BSD
++ struct ioc_vol vol;
++
++ if(ioctl(cd->cd_dev, CDIOCGETVOL, &vol) < 0)
++ return -1;
++
++ return vol.vol[0];
++#else
+ #ifdef CDROMVOLREAD
+ struct cdrom_volctrl vol;
+ int tmp;
+@@ -374,12 +492,38 @@
+ #else
+ return 0;
+ #endif
++#endif
+ }
+
+ void tcd_playtracks(cd_struct *cd, int start_t, int end_t, int only_use_trkind)
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#define MSF_START_MIN (msf.start_m)
++#define MSF_START_SEC (msf.start_s)
++#define MSF_START_FRM (msf.start_f)
++#define MSF_END_MIN (msf.end_m)
++#define MSF_END_SEC (msf.end_s)
++#define MSF_END_FRM (msf.end_f)
++ struct ioc_play_track trkind;
++#define TI_START_TRK (trkind.start_track)
++#define TI_START_IND (trkind.start_index)
++#define TI_END_TRK (trkind.end_track)
++#define TI_END_IND (trkind.end_index)
++#else
+ struct cdrom_msf msf;
++#define MSF_START_MIN (msf.cdmsf_min0)
++#define MSF_START_SEC (msf.cdmsf_sec0)
++#define MSF_START_FRM (msf.cdmsf_frame0)
++#define MSF_END_MIN (msf.cdmsf_min1)
++#define MSF_END_SEC (msf.cdmsf_sec1)
++#define MSF_END_FRM (msf.cdmsf_frame0)
+ struct cdrom_ti trkind;
++#define TI_START_TRK (trkind.cdti_trk0)
++#define TI_START_IND (trkind.cdti_ind0)
++#define TI_END_TRK (trkind.cdti_trk1)
++#define TI_END_IND (trkind.cdti_ind1)
++#endif
+ debug("cdrom.c: tcd_playtracks( %p, %d, %d )\n", cd, start_t, end_t );
+ cd->err = FALSE;
+
+@@ -390,7 +534,7 @@
+ tcd_gettime(cd);
+ if(cd->err)
+ {
+- /* try and inject cd */
++ /* try and eject cd */
+ tcd_ejectcd(cd);
+
+ if(cd->err)
+@@ -401,62 +545,79 @@
+ }
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl(cd->cd_dev, CDIOCCLOSE);
++#else
+ #if defined(CDROMCLOSETRAY)
+ if( ioctl( cd->cd_dev, CDROM_DRIVE_STATUS ) == CDS_TRAY_OPEN )
+ ioctl(cd->cd_dev, CDROMCLOSETRAY);
+ #endif
++#endif
+
++#ifdef TCD_BSD
++ if(cd->trk[start_t].toc.control == 0x04)
++#else
+ if(cd->trk[start_t].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ start_t++; /* bad hack. most data tracks are the first track... */
+
+- msf.cdmsf_min0 = cd->trk[start_t].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec0 = cd->trk[start_t].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame0 = cd->trk[start_t].toc.cdte_addr.msf.frame;
++ MSF_START_MIN = TOC_MINUTE(cd->trk[start_t]);
++ MSF_START_SEC = TOC_SECOND(cd->trk[start_t]);
++ MSF_START_FRM = TOC_FRAME(cd->trk[start_t]);
+
+ if( end_t < 0 )
+ {
+- msf.cdmsf_min1 = cd->trk[start_t].tot_min+msf.cdmsf_min0;
+- msf.cdmsf_sec1 = cd->trk[start_t].tot_sec+msf.cdmsf_sec0;
+- msf.cdmsf_frame1=0;
++ MSF_END_MIN = cd->trk[start_t].tot_min+MSF_START_MIN;
++ MSF_END_SEC = cd->trk[start_t].tot_sec+MSF_START_SEC;
++ MSF_END_FRM = 0;
+ }
+ else
+ {
+- msf.cdmsf_min1 = cd->trk[end_t+1].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[end_t+1].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[end_t+1]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[end_t+1]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[end_t+1]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if(MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+ }
+- msf.cdmsf_min1 += (msf.cdmsf_sec1 / 60);
+- msf.cdmsf_sec1 %= 60;
++ MSF_END_MIN += (MSF_END_SEC / 60);
++ MSF_END_SEC %= 60;
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++ if(only_use_trkind || ioctl( cd->cd_dev, CDIOCPLAYMSF, &msf))
++#else
+ if(ioctl( cd->cd_dev, CDROMPLAYMSF, &msf) || only_use_trkind)
++#endif
+ {
+ debug("cdrom.c: tcd_playtracks error. CDROMPLAYMSF ioctl error (or user override). Trying PLAYTRKIND\n" );
+
+ /* Try alternate method of playing */
+- trkind.cdti_trk0 = start_t; /* start track */
+- trkind.cdti_ind0 = 0; /* start index */
+- trkind.cdti_trk1 = end_t; /* end track */
+- trkind.cdti_ind1 = 0; /* end index */
++ TI_START_TRK = start_t; /* start track */
++ TI_START_IND = 0; /* start index */
++ TI_END_TRK = end_t; /* end track */
++ TI_END_IND = 0; /* end index */
+
++#ifdef TCD_BSD
++ if(ioctl(cd->cd_dev, CDIOCPLAYTRACKS, &trkind))
++#else
+ if(ioctl(cd->cd_dev, CDROMPLAYTRKIND, &trkind))
++#endif
+ {
+ strcpy( cd->errmsg, "Error playing disc" );
+ cd->err = TRUE;
+@@ -472,25 +633,15 @@
+ return;
+ }
+
+-static int msf_2_frame( cd_min_sec_frame *msf )
+-{
+- return( ( msf->minute * CD_SECS + msf->second )
+- * CD_FRAMES + msf->frame );
+-}
+-
+-static void frame_2_msf( int frame, cd_min_sec_frame *msf )
+-{
+- msf->frame = frame % CD_FRAMES;
+- frame /= CD_FRAMES;
+- msf->second = frame % CD_SECS;
+- msf->minute = frame / CD_SECS;
+-}
+-
+ int tcd_play_seconds( cd_struct *cd, long int offset )
+ {
++#ifdef TCD_BSD
++ struct ioc_play_msf msf;
++#else
+ struct cdrom_msf msf;
+ cd_min_sec_frame msf0;
+ int cur_frame, start_frame, end_frame;
++#endif
+ int tmp;
+
+ debug("cdrom.c: tcd_play_seconds( %p, %ld )\n", cd, offset );
+@@ -498,53 +649,54 @@
+ cd->err = FALSE;
+ cd->isplayable=FALSE;
+
+- /* converting msf to frames makes life much easier */
+- start_frame = msf_2_frame( &cd->trk[C(cd->first_t)].toc.cdte_addr.msf );
+- end_frame = msf_2_frame( &cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf ) - 1;
+- cur_frame = cd->cur_frame + ( offset * CD_FRAMES );
+-
+- /* keep the cur_frame within the boundaries of the first and last track */
+- if ( cur_frame < start_frame ) {
+- cur_frame = start_frame;
+- } else if ( cur_frame > end_frame ) {
+- cur_frame = end_frame;
+- }
+-
+- /* convert frames back to msf */
+- frame_2_msf( cur_frame, &msf0 );
+- msf.cdmsf_min0 = msf0.minute;
+- msf.cdmsf_sec0 = msf0.second;
+- msf.cdmsf_frame0 = msf0.frame;
+- msf.cdmsf_min1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute;
+- msf.cdmsf_sec1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second;
+- msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame;
+- decrement_msf_end_by_one (&msf);
++ /* got subchannel? */
++ MSF_START_SEC = SC_SECOND(cd->sc)+offset;
++ MSF_START_MIN = SC_MINUTE(cd->sc);
++ MSF_START_FRM = SC_FRAME(cd->sc);
++ MSF_END_MIN = TOC_MINUTE(cd->trk[C(cd->last_t+1)]);
++ MSF_END_SEC = TOC_SECOND(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM = TOC_FRAME(cd->trk[C(cd->last_t+1)]);
++ MSF_END_FRM -= 1;
+
+ #ifdef UNSIGNED_NUMBERS_CAN_BE_NEGATIVE
+- if(msf.cdmsf_frame1 < 0)
++ if((MSF_END_FRM < 0)
+ {
+- msf.cdmsf_sec1 += msf.cdmsf_frame1;
+- msf.cdmsf_frame1 = 0;
++ MSF_END_SEC += MSF_END_FRM;
++ MSF_END_FRM = 0;
+ }
+- if(msf.cdmsf_sec1 < 0)
++ if(MSF_END_SEC < 0)
+ {
+- msf.cdmsf_min1 += msf.cdmsf_sec1;
+- msf.cdmsf_sec1 = 0;
++ MSF_END_MIN += MSF_END_SEC;
++ MSF_END_SEC = 0;
+ }
+- if(msf.cdmsf_min1 < 0)
++ if(MSF_END_MIN < 0)
+ {
+- msf.cdmsf_min1 = 0;
++ MSF_END_MIN = 0;
+ }
+ #endif
+-
++
++ if(MSF_START_SEC > 60 && (offset<0))
++ {
++ MSF_START_SEC = 60-abs(offset);
++ MSF_START_MIN--;
++ }
++
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT );
++ tmp = ioctl(cd->cd_dev, CDIOCPLAYMSF, &msf);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMPLAYMSF, &msf);
++#endif
+ if(tmp)
+ {
+ strcpy( cd->errmsg, "Error playing disc." );
+ cd->err = TRUE;
+
+ debug("cdrom.c: tcd_play_seconds error. CDROMPLAYMSF ioctl error.\n" );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW );
++#endif
+ }
+ cd->isplayable=TRUE;
+ tcd_close_disc( cd );
+@@ -562,7 +714,11 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(!ioctl(cd->cd_dev, CDIOCEJECT))
++#else
+ if(!ioctl(cd->cd_dev, CDROMEJECT))
++#endif
+ {
+ cd->isplayable = FALSE;
+ strcpy(cd->errmsg, "No disc in drive ");
+@@ -570,9 +726,17 @@
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp = ioctl( cd->cd_dev, CDIOCCLOSE );
++#else
+ #ifdef CDROMCLOSETRAY
+ tmp = ioctl( cd->cd_dev, CDROMCLOSETRAY );
+ #endif
++#endif
++
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCPREVENT);
++#endif
+
+ if(tcd_post_init(cd))
+ {
+@@ -582,6 +746,9 @@
+ debug("cdrom.c: tcd_eject - disc init error. %s\n",
+ strerror(errno) );
+
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++#endif
+ return(-1);
+ }
+ cd->isplayable = TRUE;
+@@ -600,12 +767,21 @@
+ debug("cdrom.c: tcd_stopcd(%p)\n", cd );
+
+ /* SDH: Makes things cleaner on eject */
++#ifdef TCD_BSD
++ if( SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED )
++#else
+ if( cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED )
++#endif
+ tcd_pausecd(cd);
+
+ cd->err = FALSE;
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ ioctl( cd->cd_dev, CDIOCALLOW);
++ tmp = ioctl(cd->cd_dev, CDIOCSTOP);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMSTOP);
++#endif
+ tcd_close_disc ( cd );
+ if(tmp)
+ {
+@@ -626,13 +802,25 @@
+ cd->err = FALSE;
+
+ tcd_opencddev( cd, NULL );
++#ifdef TCD_BSD
++ if(SC_AUDIOSTATUS(cd->sc)==CDROM_AUDIO_PAUSED)
++#else
+ if(cd->sc.cdsc_audiostatus==CDROM_AUDIO_PAUSED)
++#endif
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCRESUME);
++#else
+ tmp = ioctl(cd->cd_dev, CDROMRESUME);
++#endif
+ }
+ else
+ {
++#ifdef TCD_BSD
++ tmp=ioctl(cd->cd_dev, CDIOCPAUSE);
++#else
+ tmp=ioctl(cd->cd_dev, CDROMPAUSE);
++#endif
+ }
+ if(tmp < 0)
+ {
+@@ -647,6 +835,7 @@
+ int tcd_change_disc( cd_struct *cd, int disc )
+ {
+ #ifdef TCD_CHANGER_ENABLED
++#ifndef TCD_BSD
+ int tmp;
+ cd->err = FALSE;
+
+@@ -657,6 +846,7 @@
+ fprintf( stdout, "ioctl: %s\n", strerror(errno) );
+
+ return tmp;
++#endif
+ #else
+ debug("tcd_change_disc called, but changer support isn't compiled in. Ickyblah.\n" );
+ return 0;
diff --git a/audio/gnomemedia2/files/patch-tcd::linux-cdrom.h b/audio/gnomemedia2/files/patch-tcd::linux-cdrom.h
new file mode 100644
index 000000000000..dabc669f77d6
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::linux-cdrom.h
@@ -0,0 +1,73 @@
+
+$FreeBSD$
+
+--- tcd/linux-cdrom.h 2001/07/13 09:27:50 1.1
++++ tcd/linux-cdrom.h 2001/07/13 09:34:48
+@@ -27,8 +27,20 @@
+
+ #include <sys/types.h>
+ #include <glib.h>
+-#if !defined(linux) && !defined(sun) && !defined(__sun__)
+-# error TCD only builds on linux and Solaris/SunOs
++#if !defined(linux) && !defined(sun) && !defined(__sun__) && !defined(__FreeBSD__)
++# error TCD only builds on linux, Solaris/SunOs and FreeBSD
++#endif
++
++#ifdef __FreeBSD__
++#define TCD_BSD
++#include <sys/cdio.h>
++#define CDROM_AUDIO_INVALID CD_AS_AUDIO_INVALID
++#define CDROM_AUDIO_PLAY CD_AS_PLAY_IN_PROGRESS
++#define CDROM_AUDIO_PAUSED CD_AS_PLAY_PAUSED
++#define CDROM_AUDIO_COMPLETED CD_AS_PLAY_COMPLETED
++#define CDROM_AUDIO_ERROR CD_AS_PLAY_ERROR
++#define CDROM_AUDIO_NO_STATUS CD_AS_NO_STATUS
++#define CDROM
+ #endif
+
+ #ifdef linux
+@@ -126,7 +138,17 @@
+ {
+ char name[TRK_NAME_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this track */
++#ifdef TCD_BSD
++ struct cd_toc_entry toc;
++#define TOC_MINUTE(trk) (trk.toc.addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.addr.msf.frame)
++#else
+ struct cdrom_tocentry toc;
++#define TOC_MINUTE(trk) (trk.toc.cdte_addr.msf.minute)
++#define TOC_SECOND(trk) (trk.toc.cdte_addr.msf.second)
++#define TOC_FRAME(trk) (trk.toc.cdte_addr.msf.frame)
++#endif
+ int titled;
+ int start, length;
+ int tot_min, tot_sec;
+@@ -152,10 +174,26 @@
+ char album[DISC_INFO_LEN+1], artist[DISC_INFO_LEN+1];
+ char extd[EXT_DATA_LEN+1]; /* extra information for this disc */
+
++#ifdef TCD_BSD
++ /* See /usr/include/sys/cdio.h */
++ struct ioc_play_track ti;
++ struct ioc_toc_header tochdr;
++ struct cd_sub_channel_info sc;
++#define SC_AUDIOSTATUS(sc) (sc.header.audio_status)
++#define SC_TRACK(sc) (sc.what.position.track_number)
++#define SC_MINUTE(sc) (sc.what.position.absaddr.msf.minute)
++#define SC_SECOND(sc) (sc.what.position.absaddr.msf.second)
++#define SC_FRAME(sc) (sc.what.position.absaddr.msf.frame)
++#else
+ /* See /usr/src/linux/include/linux/cdrom.h */
+ struct cdrom_ti ti; /* Track info */
+ struct cdrom_tochdr tochdr; /* TOC header */
+ struct cdrom_subchnl sc; /* Subchannel, for time */
++#define SC_AUDIOSTATUS(sc) (sc.cdsc_audiostatus)
++#define SC_TRACK(sc) (sc.cdsc_trk)
++#define SC_SECOND(sc) (sc.cdsc_absaddr.msf.second)
++#define SC_FRAME(sc) (sc.cdsc_absaddr.msf.frame)
++#endif
+ int volume; /* Must range 0-100 */
+
+ int cd_min, cd_sec; /* Total CD time */
diff --git a/audio/gnomemedia2/files/patch-tcd::tcd.c b/audio/gnomemedia2/files/patch-tcd::tcd.c
new file mode 100644
index 000000000000..7946bdbe12ff
--- /dev/null
+++ b/audio/gnomemedia2/files/patch-tcd::tcd.c
@@ -0,0 +1,79 @@
+
+$FreeBSD$
+
+--- tcd/tcd.c 2001/07/13 09:35:21 1.1
++++ tcd/tcd.c 2001/07/13 09:39:30
+@@ -142,8 +142,8 @@
+
+ /* if the user hasn't stopped the cd, but it is
+ stopped anyway, fix it. */
+- if( cd->sc.cdsc_audiostatus != CDROM_AUDIO_PLAY &&
+- cd->sc.cdsc_audiostatus != CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PLAY &&
++ SC_AUDIOSTATUS(cd->sc) != CDROM_AUDIO_PAUSED )
+ {
+ if( cd->play_method == REPEAT_CD )
+ tcd_playtracks(cd, cd->first_t, cd->last_t, 0);
+@@ -173,7 +173,7 @@
+ case 'p':
+ case 'P':
+ if(cd->isplayable) {
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PAUSED )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PAUSED )
+ tcd_pausecd(cd);
+ else
+ tcd_playtracks(cd,cd->first_t,cd->last_t, 0);
+@@ -443,8 +443,8 @@
+ mvwprintw(win,maxy-2,30,"Track:" );
+ attron( C_RED+A_BOLD );
+ mvwprintw(win,maxy-4,38,"%02u:%02u",
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.minute,
+- cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.second );
++ TOC_MINUTE(cd->trk[C(cd->last_t+1)]),
++ TOC_SECOND(cd->trk[C(cd->last_t+1)]) );
+ mvwprintw(win,maxy-3,38,cd->dtitle );
+ attroff( C_RED+A_BOLD );
+ }
+@@ -481,11 +481,15 @@
+ j=height;
+ for(i=cd->first_t; i <= cd->last_t; i++)
+ {
+- if(cd->cur_t == i && cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY)
++ if(cd->cur_t == i && SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY)
+ stat = 'P';
+ else if(cd->repeat_track == i)
+ stat = 'R';
++#ifdef TCD_BSD
++ else if(cd->trk[i].toc.control == 0x04)
++#else
+ else if(cd->trk[i].toc.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ stat = 'd';
+ else
+ stat = 'a';
+@@ -501,14 +505,14 @@
+ x = 2;
+ }
+
+- if( cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i )
++ if( SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i )
+ attron( A_BOLD );
+
+ mvwprintw(win,y,x,"%02u%c - %02u:%02u",
+ i, stat,cd->trk[C(i)].tot_min,
+ cd->trk[C(i)].tot_sec );
+
+- if(cd->sc.cdsc_audiostatus == CDROM_AUDIO_PLAY && cd->cur_t == i)
++ if(SC_AUDIOSTATUS(cd->sc) == CDROM_AUDIO_PLAY && cd->cur_t == i)
+ attroff( A_BOLD );
+ }
+ }
+@@ -519,7 +523,7 @@
+
+ if( !cd->err )
+ {
+- switch( cd->sc.cdsc_audiostatus )
++ switch( SC_AUDIOSTATUS(cd->sc) )
+ {
+ case CDROM_AUDIO_INVALID:
+ strcpy( tmp,"No Audio " );
diff --git a/audio/gnomemedia2/pkg-plist b/audio/gnomemedia2/pkg-plist
index 9519b4d3804f..8d5cfa19919c 100644
--- a/audio/gnomemedia2/pkg-plist
+++ b/audio/gnomemedia2/pkg-plist
@@ -4,13 +4,55 @@ bin/gmix
bin/grecord
bin/gtcd
bin/vumeter
+etc/CORBA/servers/gtcd.goad
share/gnome/apps/Multimedia/Soundrecorder.desktop
share/gnome/apps/Multimedia/gmix.desktop
share/gnome/apps/Multimedia/gtcd.desktop
share/gnome/apps/Multimedia/vumeter.desktop
share/gnome/cddb-submit-methods
+share/gnome/help/gmix/C/authors.html
+share/gnome/help/gmix/C/bugs.html
+share/gnome/help/gmix/C/figures/gmix-prefs.png
+share/gnome/help/gmix/C/figures/gmix.png
+share/gnome/help/gmix/C/gmix-prefs.html
+share/gnome/help/gmix/C/gmix-use.html
+share/gnome/help/gmix/C/gmix.sgml
+share/gnome/help/gmix/C/index.html
+share/gnome/help/gmix/C/license.html
+share/gnome/help/gmix/C/ln7.html
+share/gnome/help/gmix/C/topic.dat
+share/gnome/help/gmix/it/authors.html
+share/gnome/help/gmix/it/bugs.html
+share/gnome/help/gmix/it/figures/gmix-prefs.png
+share/gnome/help/gmix/it/figures/gmix.png
+share/gnome/help/gmix/it/gmix-prefs.html
+share/gnome/help/gmix/it/gmix-use.html
+share/gnome/help/gmix/it/gmix.sgml
+share/gnome/help/gmix/it/index.html
+share/gnome/help/gmix/it/license.html
+share/gnome/help/gmix/it/ln10.html
+share/gnome/help/gmix/it/topic.dat
+share/gnome/help/gtcd/C/authors.html
+share/gnome/help/gtcd/C/bugs.html
+share/gnome/help/gtcd/C/figures/gtcd-props.png
+share/gnome/help/gtcd/C/figures/gtcd-window.png
+share/gnome/help/gtcd/C/figures/gtcd.png
+share/gnome/help/gtcd/C/figures/track-number.png
+share/gnome/help/gtcd/C/figures/track-time.png
+share/gnome/help/gtcd/C/figures/trackeditor.png
+share/gnome/help/gtcd/C/gtcd.sgml
+share/gnome/help/gtcd/C/index.html
+share/gnome/help/gtcd/C/license.html
+share/gnome/help/gtcd/C/ln7.html
+share/gnome/help/gtcd/C/topic.dat
+share/gnome/help/gtcd/C/usage.html
+share/gnome/idl/gtcd.idl
share/gnome/mime-info/grecord.keys
share/gnome/mime-info/grecord.mime
+share/gnome/omf/gnome-media/gmix-C.omf
+share/gnome/omf/gnome-media/gmix-it.omf
+share/gnome/omf/gnome-media/gtcd-C.omf
+share/gnome/pixmaps/gnome-grecord.png
share/gnome/pixmaps/gnome-mixer.png
share/gnome/pixmaps/gnome-vumeter.png
share/gnome/pixmaps/gtcd.png
@@ -24,6 +66,7 @@ share/gnome/pixmaps/tcd/play.xpm
share/gnome/pixmaps/tcd/prev_t.xpm
share/gnome/pixmaps/tcd/rw.xpm
share/gnome/pixmaps/tcd/stop.xpm
+share/locale/az/LC_MESSAGES/gnome-media.mo
share/locale/ca/LC_MESSAGES/gnome-media.mo
share/locale/cs/LC_MESSAGES/gnome-media.mo
share/locale/da/LC_MESSAGES/gnome-media.mo
@@ -48,9 +91,23 @@ share/locale/pt/LC_MESSAGES/gnome-media.mo
share/locale/pt_BR/LC_MESSAGES/gnome-media.mo
share/locale/ro/LC_MESSAGES/gnome-media.mo
share/locale/ru/LC_MESSAGES/gnome-media.mo
+share/locale/sk/LC_MESSAGES/gnome-media.mo
+share/locale/sl/LC_MESSAGES/gnome-media.mo
share/locale/sv/LC_MESSAGES/gnome-media.mo
share/locale/tr/LC_MESSAGES/gnome-media.mo
share/locale/uk/LC_MESSAGES/gnome-media.mo
share/locale/zh_CN.GB2312/LC_MESSAGES/gnome-media.mo
share/locale/zh_TW.Big5/LC_MESSAGES/gnome-media.mo
-@dirrm share/gnome/pixmaps/tcd/
+@dirrm share/gnome/pixmaps/tcd
+@dirrm share/gnome/omf/gnome-media
+@dirrm share/gnome/help/gtcd/C/stylesheet-images
+@dirrm share/gnome/help/gtcd/C/figures
+@dirrm share/gnome/help/gtcd/C
+@dirrm share/gnome/help/gtcd
+@dirrm share/gnome/help/gmix/it/stylesheet-images
+@dirrm share/gnome/help/gmix/it/figures
+@dirrm share/gnome/help/gmix/it
+@dirrm share/gnome/help/gmix/C/stylesheet-images
+@dirrm share/gnome/help/gmix/C/figures
+@dirrm share/gnome/help/gmix/C
+@dirrm share/gnome/help/gmix