openbsd-ports/multimedia/lsdvd/patches/patch-lsdvd_c
ckuethe 6836dc303e fix HOMEPAGE. remove extra blank line at end of human-readable output.
verbose dump of IFO structure if -vvv is specified. ok jim@
2010-06-28 19:22:50 +00:00

108 lines
3.1 KiB
Plaintext

$OpenBSD: patch-lsdvd_c,v 1.4 2010/06/28 19:22:50 ckuethe Exp $
--- lsdvd.c.orig Thu Mar 2 05:48:11 2006
+++ lsdvd.c Fri Apr 23 14:28:41 2010
@@ -13,7 +13,9 @@
* 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 <stdint.h>
#include <dvdread/ifo_read.h>
+#include <dvdread/ifo_print.h>
#include <string.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -119,6 +121,7 @@ void converttime(playback_time_t *pt, dvd_time_t *dt)
/*
* The following method is based on code from vobcopy, by Robos, with thanks.
+ * It fails opening a directory (like /home/movies/casablanca/VIDEO_TS/)
*/
int get_title_name(const char* dvd_device, char* title)
{
@@ -130,6 +133,7 @@ int get_title_name(const char* dvd_device, char* title
strcpy(title, "unknown");
return -1;
}
+ fprintf(stderr, "opening %s for title\n", dvd_device);
if ( fseek(filehandle, 32808, SEEK_SET )) {
fclose(filehandle);
@@ -196,7 +200,7 @@ void usage()
fprintf(stderr, "\n");
}
-int opt_a=0, opt_c=0, opt_n=0, opt_p=0, opt_q=0, opt_s=0, opt_t=0, opt_v=0, opt_x=0, opt_d=0, opt_P=0;
+int opt_a=0, opt_c=0, opt_m=0, opt_n=0, opt_p=0, opt_q=0, opt_s=0, opt_t=0, opt_v=0, opt_x=0, opt_d=0, opt_P=0;
char opt_O='h';
char output_option(char *arg)
@@ -235,7 +239,7 @@ int main(int argc, char *argv[])
pgc_t *pgc;
int i, j, c, titles, cell, vts_ttn, title_set_nr;
char lang_code[3];
- char *dvd_device = "/dev/dvd";
+ char *dvd_device = "/dev/rcd0c";
int has_title = 0, ret = 0;
int max_length = 0, max_track = 0;
struct stat dvd_stat;
@@ -252,18 +256,20 @@ int main(int argc, char *argv[])
case 's': opt_s = 1; break;
case 'q': opt_q = 1; break;
case 'c': opt_c = 1; break;
+ case 'm': opt_m = 1; break;
case 'n': opt_n = 1; break;
case 'p': opt_p = 1; break;
case 'P': opt_P = 1; break;
case 't': opt_t = atoi(optarg); break;
case 'O': opt_O = output_option(optarg); break;
- case 'v': opt_v = 1; break;
+ case 'v': opt_v++; break;
case 'x': opt_x = 1;
opt_a = 1;
opt_c = 1;
opt_s = 1;
opt_P = 1;
opt_d = 1;
+ opt_m = 1;
opt_n = 1;
opt_v = 1; break;
}
@@ -287,6 +293,12 @@ int main(int argc, char *argv[])
fprintf( stderr, "Can't open main ifo!\n");
return 3;
}
+ if (opt_v > 2) {
+ printf("Title 0 IFO dump\n");
+ printf("================\n");
+ ifoPrint(dvd, 0);
+ printf("\n");
+ }
ifo = (ifo_handle_t **)malloc((ifo_zero->vts_atrt->nr_of_vtss + 1) * sizeof(ifo_handle_t *));
@@ -296,6 +308,12 @@ int main(int argc, char *argv[])
fprintf( stderr, "Can't open ifo %d!\n", i);
return 4;
}
+ if (opt_v > 2) {
+ printf("Title %2d IFO dump\n", i);
+ printf("=================\n");
+ ifoPrint(dvd, i);
+ printf("\n");
+ }
}
titles = ifo_zero->tt_srpt->nr_of_srpts;
@@ -377,6 +395,11 @@ int main(int argc, char *argv[])
dvd_info.titles[j].angle_count = ifo_zero->tt_srpt->title[j].nr_of_angles;
} else {
dvd_info.titles[j].angle_count = 0;
+ }
+
+ // MENU STRUCTURE
+ if (opt_m) {
+ // void ifoPrint(dvd_reader_t *, int);
}
// AUDIO