e2615fc74c
From Xine-lib source repo ok jakemsr@
103 lines
3.8 KiB
Plaintext
103 lines
3.8 KiB
Plaintext
$OpenBSD: patch-src_input_input_cdda_c,v 1.6 2008/08/31 00:35:08 brad Exp $
|
|
--- src/input/input_cdda.c.orig Wed Aug 13 12:33:05 2008
|
|
+++ src/input/input_cdda.c Wed Aug 27 19:50:47 2008
|
|
@@ -72,7 +72,7 @@
|
|
#elif defined(WIN32)
|
|
#define DEFAULT_CDDA_DEVICE "d:\\"
|
|
#else
|
|
-#define DEFAULT_CDDA_DEVICE "/dev/cdrom"
|
|
+#define DEFAULT_CDDA_DEVICE "/dev/rcd0c"
|
|
#endif
|
|
|
|
#define CDDB_SERVER "freedb.freedb.org"
|
|
@@ -136,7 +136,7 @@ typedef struct {
|
|
char *disc_category;
|
|
|
|
int fd;
|
|
- unsigned long disc_id;
|
|
+ uint32_t disc_id;
|
|
|
|
int disc_length;
|
|
trackinfo_t *track;
|
|
@@ -611,7 +611,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this
|
|
return 0;
|
|
}
|
|
|
|
-#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__)
|
|
+#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
|
|
|
#include <sys/cdio.h>
|
|
|
|
@@ -624,7 +624,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
|
|
struct ioc_toc_header tochdr;
|
|
#if defined(__FreeBSD_kernel__)
|
|
struct ioc_read_toc_single_entry tocentry;
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
struct ioc_read_toc_entry tocentry;
|
|
struct cd_toc_entry data;
|
|
#endif
|
|
@@ -659,7 +659,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
|
|
perror("CDIOREADTOCENTRY");
|
|
return -1;
|
|
}
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
memset(&data, 0, sizeof(data));
|
|
tocentry.data_len = sizeof(data);
|
|
tocentry.data = &data;
|
|
@@ -680,7 +680,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
|
|
(tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * CD_FRAMES_PER_SECOND) +
|
|
(tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) +
|
|
tocentry.entry.addr.msf.frame;
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
toc->toc_entries[i-1].track_mode = (tocentry.data->control & 0x04) ? 1 : 0;
|
|
toc->toc_entries[i-1].first_frame_minute = tocentry.data->addr.msf.minute;
|
|
toc->toc_entries[i-1].first_frame_second = tocentry.data->addr.msf.second;
|
|
@@ -702,7 +702,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
|
|
perror("CDIOREADTOCENTRY");
|
|
return -1;
|
|
}
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
memset(&data, 0, sizeof(data));
|
|
tocentry.data_len = sizeof(data);
|
|
tocentry.data = &data;
|
|
@@ -723,7 +723,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
|
|
(tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * CD_FRAMES_PER_SECOND) +
|
|
(tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) +
|
|
tocentry.entry.addr.msf.frame;
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
toc->leadout_track.track_mode = (tocentry.data->control & 0x04) ? 1 : 0;
|
|
toc->leadout_track.first_frame_minute = tocentry.data->addr.msf.minute;
|
|
toc->leadout_track.first_frame_second = tocentry.data->addr.msf.second;
|
|
@@ -761,7 +761,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this
|
|
perror("CDIOCREADAUDIO");
|
|
return -1;
|
|
}
|
|
-#elif defined(__NetBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
scsireq_t req;
|
|
int nblocks = 1;
|
|
|
|
@@ -1902,7 +1902,7 @@ static unsigned int _cdda_cddb_sum(int n) {
|
|
}
|
|
return ret;
|
|
}
|
|
-static unsigned long _cdda_calc_cddb_id(cdda_input_plugin_t *this) {
|
|
+static uint32_t _cdda_calc_cddb_id(cdda_input_plugin_t *this) {
|
|
int i, tsum = 0;
|
|
|
|
if(this == NULL || (this->cddb.num_tracks <= 0))
|
|
@@ -1959,7 +1959,7 @@ static void _cdda_cdindex(cdda_input_plugin_t *this, c
|
|
/*
|
|
* return cbbd disc id.
|
|
*/
|
|
-static unsigned long _cdda_get_cddb_id(cdda_input_plugin_t *this) {
|
|
+static uint32_t _cdda_get_cddb_id(cdda_input_plugin_t *this) {
|
|
|
|
if(this == NULL || (this->cddb.num_tracks <= 0))
|
|
return 0;
|