head 1.6; access; symbols pkgsrc-2014Q3:1.5.0.42 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.40 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.38 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.36 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.34 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.32 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.30 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.5.0.28 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.26 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.24 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.5.0.22 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.5.0.20 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q3:1.5.0.18 pkgsrc-2011Q3-base:1.5 pkgsrc-2011Q2:1.5.0.16 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.14 pkgsrc-2011Q1-base:1.5 pkgsrc-2010Q4:1.5.0.12 pkgsrc-2010Q4-base:1.5 pkgsrc-2010Q3:1.5.0.10 pkgsrc-2010Q3-base:1.5 pkgsrc-2010Q2:1.5.0.8 pkgsrc-2010Q2-base:1.5 pkgsrc-2010Q1:1.5.0.6 pkgsrc-2010Q1-base:1.5 pkgsrc-2009Q4:1.5.0.4 pkgsrc-2009Q4-base:1.5 pkgsrc-2009Q3:1.5.0.2 pkgsrc-2009Q3-base:1.5 pkgsrc-2009Q2:1.3.0.24 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.22 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.20 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.18 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.16 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.14 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.12 pkgsrc-2008Q1:1.3.0.10 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.8 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.6 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.4 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.2 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.2.0.4 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.2 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.1.0.2 pkgsrc-2006Q2-base:1.1; locks; strict; comment @# @; 1.6 date 2014.10.13.18.29.55; author snj; state dead; branches; next 1.5; commitid FCcLzte4M34Mo4Ux; 1.5 date 2009.08.23.15.06.37; author wiz; state Exp; branches; next 1.4; 1.4 date 2009.08.22.21.44.27; author abs; state Exp; branches; next 1.3; 1.3 date 2007.02.26.17.55.14; author snj; state Exp; branches; next 1.2; 1.2 date 2006.08.24.09.58.15; author xtraeme; state Exp; branches; next 1.1; 1.1 date 2006.04.15.21.23.40; author wiz; state Exp; branches; next ; desc @@ 1.6 log @Update lsdvd to 0.17. Changes: * Ignore 'phantom' audio, subtitle tracks * Check for garbage in the program chains, which indicate that a track is non-existant, to work around additional copy protection * Fix displaying content type for audio tracks, subtitles * Fix pallete display of first entry * Fix include orders * Ignore read errors in titles that would not be displayed anyway * Fix the chapter count * Make sure the array size and the array limit used when initialising the palette size is the same. * Fix array printing. * Correct subsecond calculations. * Add sector information to the output format. * Clean up code to be closer to ANSI C and compile without warnings with more GCC compiler warnings. @ text @$NetBSD: patch-ab,v 1.5 2009/08/23 15:06:37 wiz Exp $ --- lsdvd.c.orig 2006-03-02 13:48:11.000000000 +0000 +++ lsdvd.c @@@@ -13,6 +13,7 @@@@ * 2003-04-19 Cleanups get_title_name, added dvdtime2msec, added helper macros, * output info structures in form of a Perl module, by Henk Vergonet. */ +#include #include #include #include @@@@ -131,19 +132,26 @@@@ int get_title_name(const char* dvd_devic return -1; } - if ( fseek(filehandle, 32808, SEEK_SET )) { + if ( fseek(filehandle, 32768, SEEK_SET )) { fclose(filehandle); fprintf(stderr, "Couldn't seek in %s for title\n", dvd_device); strcpy(title, "unknown"); return -1; } - if ( 32 != (i = fread(title, 1, 32, filehandle)) ) { + { + #define DVD_SEC_SIZ 2048 + char tempBuf[ DVD_SEC_SIZ ]; + + if ( DVD_SEC_SIZ != fread(tempBuf, 1, DVD_SEC_SIZ, filehandle) ) { fclose(filehandle); fprintf(stderr, "Couldn't read enough bytes for title.\n"); strcpy(title, "unknown"); return -1; } + snprintf( title, 32, "%s", tempBuf + 40 ); + i=32; + } fclose (filehandle); @@@@ -239,6 +247,7 @@@@ int main(int argc, char *argv[]) int has_title = 0, ret = 0; int max_length = 0, max_track = 0; struct stat dvd_stat; + struct dvd_info dvd_info; program_name = argv[0]; @@@@ -276,6 +285,9 @@@@ int main(int argc, char *argv[]) fprintf(stderr, "Can't find device %s\n", dvd_device); return 1; } + + /* On at least NetBSD this fails if called after DVDOpen */ + has_title = get_title_name(dvd_device, title); dvd = DVDOpen(dvd_device); if( !dvd ) { @@@@ -305,12 +317,8 @@@@ int main(int argc, char *argv[]) return 5; } - has_title = get_title_name(dvd_device, title); - vmgi_mat = ifo_zero->vmgi_mat; - struct dvd_info dvd_info; - dvd_info.discinfo.device = dvd_device; dvd_info.discinfo.disc_title = has_title ? "unknown" : title; dvd_info.discinfo.vmg_id = vmgi_mat->vmg_identifier; @@@@ -409,14 +417,16 @@@@ int main(int argc, char *argv[]) cell = 0; if (opt_c) { + int ms; + dvd_info.titles[j].chapter_count = pgc->nr_of_programs; dvd_info.titles[j].chapters = calloc(dvd_info.titles[j].chapter_count, sizeof(*dvd_info.titles[j].chapters)); - int ms; for (i=0; inr_of_programs; i++) { + int next; ms=0; - int next = pgc->program_map[i+1]; + next = pgc->program_map[i+1]; if (i == pgc->nr_of_programs - 1) next = pgc->nr_of_cells + 1; while (cell < next - 1) @ 1.5 log @Remove chunk that only adds whitespace. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.4 2009/08/22 21:44:27 abs Exp $ @ 1.4 log @Fix lsdvd so it can ready the dvd title under NetBSD. Bump pkgrevision @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.3 2007/02/26 17:55:14 snj Exp $ a91 8 @@@@ -500,6 +510,7 @@@@ int main(int argc, char *argv[]) for (i=1; i <= ifo_zero->vts_atrt->nr_of_vtss; i++) { ifoClose(ifo[i]); } + ifoClose(ifo_zero); DVDClose(dvd); @ 1.3 log @Apply patch from Kimura Fuyuki in PR pkg/35703: Fix printing of DVD titles. Originally from FreeBSD ports. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.2 2006/08/24 09:58:15 xtraeme Exp $ d3 2 a4 2 --- lsdvd.c.orig 2006-08-24 11:51:58.000000000 +0200 +++ lsdvd.c 2006-08-24 11:52:09.000000000 +0200 d50 13 a62 1 @@@@ -309,8 +318,6 @@@@ int main(int argc, char *argv[]) d64 2 d73 1 a73 1 @@@@ -409,14 +416,16 @@@@ int main(int argc, char *argv[]) d92 8 @ 1.2 log @Update to 0.16: 12/12/05 - 0.16 Addition of #include to support newer libdvdread versions. Abstraction of code to new generic interface. 15/10/04 - 0.15 abstraction of dvd contents to new struct. addition of xml output. additional -O option. stream ids and osd palette added. @ text @d1 1 a1 1 $NetBSD$ d13 65 @ 1.1 log @Fix build with newer libdvdread. @ text @d3 2 a4 2 --- lsdvd.c.orig 2003-09-29 21:01:00.000000000 +0000 +++ lsdvd.c d7 1 a7 1 * output info structures in form of a Perl module, by Henk Vergonet. @