head 1.3; access; symbols pkgsrc-2014Q3:1.2.0.12 pkgsrc-2014Q3-base:1.2 pkgsrc-2014Q2:1.2.0.10 pkgsrc-2014Q2-base:1.2 pkgsrc-2014Q1:1.2.0.8 pkgsrc-2014Q1-base:1.2 pkgsrc-2013Q4:1.2.0.6 pkgsrc-2013Q4-base:1.2 pkgsrc-2013Q3:1.2.0.4 pkgsrc-2013Q3-base:1.2 pkgsrc-2013Q2:1.2.0.2 pkgsrc-2013Q2-base:1.2 pkgsrc-2013Q1:1.1.0.30 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.28 pkgsrc-2012Q4-base:1.1 pkgsrc-2012Q3:1.1.0.26 pkgsrc-2012Q3-base:1.1 pkgsrc-2012Q2:1.1.0.24 pkgsrc-2012Q2-base:1.1 pkgsrc-2012Q1:1.1.0.22 pkgsrc-2012Q1-base:1.1 pkgsrc-2011Q4:1.1.0.20 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.18 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.16 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.14 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.12 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.10 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.8 pkgsrc-2010Q2-base:1.1 pkgsrc-2010Q1:1.1.0.6 pkgsrc-2010Q1-base:1.1 pkgsrc-2009Q4:1.1.0.4 pkgsrc-2009Q4-base:1.1 pkgsrc-2009Q3:1.1.0.2 pkgsrc-2009Q3-base:1.1; locks; strict; comment @# @; 1.3 date 2014.11.21.22.59.47; author mef; state dead; branches; next 1.2; commitid 881p6eTL1M7oD6Zx; 1.2 date 2013.06.16.09.58.48; author shattered; state Exp; branches; next 1.1; commitid ooROee3oGMvK7PTw; 1.1 date 2009.07.07.17.44.51; author drochner; state Exp; branches; next ; desc @@ 1.3 log @(pkgsrc) - delete patch-ab, NetBSD support improved since 0.5.1 (upstream) - Update 0.5.0 to 0.6.1 libdiscid ChangeLog: -------------------- libdiscid-0.6.1: - LIB-59: windows: fix bug preventing ISRC reads libdiscid-0.6.0: - LIB-41: add discid_get_troc_string() for fuzzy toc lookup - LIB-54: add libmusicbrainz example with fuzzy toc lookup - LIB-43: windows: the default drive is the first cd drive letter - LIB-45: Linux/BSD/Solaris: try several possible default device names - LIB-28: Mac: allow drive numbers as devices, default now "1" - LIB-55, LIB-56: allow drive numbers for Windows and Linux - LIB-53: discid_get_submission_url() returns the new NGS url currently no functional change, the old url was redirected - LIB-52: more validation for parameters of discid_put() - LIB-48: assert successful read/put when API is used - the discisrc example prints the name of the device usedp libdiscid-0.5.2: - LIB-51: fix ISRC reading on Mac OS X again - LIB-50: fix segfault in mb_disc_load_toc on Solaris - LIB-26: add a better test suite, including valgrind memcheck target - print time information in the discid example libdiscid-0.5.1: - LIB-40: discid_get_webservice_url() (web service version 1) is deprecated please use libmusicbrainz to gather metadata by disc ID - LIB-7: rewrote data track handling, releases with multiple data tracks This also fixes LIB-18 (no ID for DVDs) and LIB-9 (PS/PS2 CDs) - LIB-44: fix invalid disc IDs on first read of multi-session discs - LIB-37: Autotools optimization (non-recursive build etc.) - LIB-42: remove Windows 9x platform code - renamed openbsd platform code to netbsd, still used by both. @ text @$NetBSD: patch-ab,v 1.2 2013/06/16 09:58:48 shattered Exp $ --- src/disc_freebsd.c.orig 2013-04-12 11:46:44.000000000 +0000 +++ src/disc_freebsd.c @@@@ -47,11 +47,19 @@@@ #define MB_DEFAULT_DEVICE "/dev/acd0" #define XA_INTERVAL ((60 + 90 + 2) * CD_FRAMES) - + +#ifdef __NetBSD__ +#define CDIOREADTOCENTRY CDIOREADTOCENTRIES +#endif static int read_toc_header(int fd, int *first, int *last) { struct ioc_toc_header th; +#ifdef __NetBSD__ + struct cd_toc_entry td; + struct ioc_read_toc_entry te; +#else struct ioc_read_toc_single_entry te; +#endif int ret = ioctl(fd, CDIOREADTOCHEADER, &th); @@@@ -67,10 +75,20 @@@@ static int read_toc_header(int fd, int * * session are handled correctly. */ te.address_format = CD_LBA_FORMAT; +#ifdef __NetBSD__ + te.starting_track = th.ending_track; + te.data_len = sizeof(td); + te.data = &td; +#else te.track = th.ending_track; +#endif ret = ioctl(fd, CDIOREADTOCENTRY, &te); +#ifdef __NetBSD__ + if (( td.control & CD_DATA_TRACK) != 0 ) +#else if (( te.entry.control & CD_DATA_TRACK) != 0 ) +#endif (*last)--; return ret; @@@@ -78,17 +96,32 @@@@ static int read_toc_header(int fd, int * static int read_toc_entry(int fd, int track_num, unsigned long *lba) { +#ifdef __NetBSD__ + struct cd_toc_entry td; + struct ioc_read_toc_entry te; +#else struct ioc_read_toc_single_entry te; +#endif int ret; +#ifdef __NetBSD__ + te.starting_track = track_num; + te.data_len = sizeof(td); + te.data = &td; +#else te.track = track_num; +#endif te.address_format = CD_LBA_FORMAT; ret = ioctl(fd, CDIOREADTOCENTRY, &te); assert( te.address_format == CD_LBA_FORMAT ); if ( ret == 0 ) +#ifdef __NetBSD__ + *lba = td.addr.lba; +#else *lba = ntohl(te.entry.addr.lba); +#endif return ret; } @@@@ -96,16 +129,32 @@@@ static int read_toc_entry(int fd, int tr static int read_leadout(int fd, unsigned long *lba) { struct ioc_toc_header th; +#ifdef __NetBSD__ + struct cd_toc_entry td; + struct ioc_read_toc_entry te; +#else struct ioc_read_toc_single_entry te; +#endif int ret; ret = ioctl(fd, CDIOREADTOCHEADER, &th); +#ifdef __NetBSD__ + te.starting_track = th.ending_track; + te.data_len = sizeof(td); + te.data = &td; +#else te.track = th.ending_track; +#endif te.address_format = CD_LBA_FORMAT; ret = ioctl(fd, CDIOREADTOCENTRY, &te); +#ifdef __NetBSD__ + if (( td.control & CD_DATA_TRACK) != 0 ) { + *lba = td.addr.lba - 11400; +#else if (( te.entry.control & CD_DATA_TRACK) != 0 ) { *lba = ntohl(te.entry.addr.lba) - 11400; +#endif return ret; } @ 1.2 log @Update to 0.5.0. Changes: - Read ISRCs and MCNs on Linux, Mac OS X and Windows. - Add read_sparse() for faster reading again - Added Solaris, OpenBSD and kFreeBSD support. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @update to 0.2.2 changes: -Addded the discid_get_webservice_url() function -portability improvements pkgsrc change: add NetBSD support @ text @d3 1 a3 1 --- src/disc_freebsd.c.orig 2008-01-12 12:41:51.000000000 +0100 d5 2 a6 1 @@@@ -45,6 +45,9 @@@@ d9 2 a10 1 a14 4 /* TODO: make sure it's available */ int snprintf(char *str, size_t size, const char *format, ...); @@@@ -52,7 +55,12 @@@@ int snprintf(char *str, size_t size, con d26 1 a26 1 @@@@ -68,10 +76,20 @@@@ static int read_toc_header(int fd, int * d47 1 a47 1 @@@@ -79,17 +97,32 @@@@ static int read_toc_header(int fd, int * d80 1 a80 1 @@@@ -97,16 +130,32 @@@@ static int read_toc_entry(int fd, int tr @