pkgsrc/multimedia/regionset/patches/patch-ab
2005-12-07 18:38:27 +00:00

57 lines
2.2 KiB
Text

$NetBSD: patch-ab,v 1.4 2005/12/07 18:38:27 joerg Exp $
--- regionset.c.old 2003-10-30 07:32:34.000000000 -0500
+++ regionset.c 2005-04-16 02:42:40.000000000 -0400
@@ -27,7 +27,11 @@
#include <stdio.h>
#include "dvd_udf.h"
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#define DEFAULTDEVICE "/dev/cd0a"
+#else /* linux */
#define DEFAULTDEVICE "/dev/dvd"
+#endif
#define VERSION "0.1"
int main (int argc, char* argv[])
@@ -39,8 +43,9 @@
if (argc>1) err=UDFOpenDisc(argv[1]);
else err=UDFOpenDisc(DEFAULTDEVICE);
if (err<0) {
- printf("ERROR: Could not open disc \"%s\"!\n",((argc>=1)?argv[1]:DEFAULTDEVICE));
+ printf("ERROR: Could not open disc \"%s\"!\n",((argc>=2)?argv[1]:DEFAULTDEVICE));
printf("Ensure that there is any readable CD or DVD in the drive.\n");
+ printf("usage: regionset [dvd-device-node]\n");
return 1;
}
if (UDFRPCGet(&type,&vra,&ucca,&region_mask,&rpc_scheme)) {
@@ -60,6 +65,20 @@
printf("Would you like to change the region setting of your drive? [y/n]:");
fgets(ch,3,stdin);
if ((ch[0]=='y') || (ch[0]=='Y')) {
+ printf("Choices include (not complete list):\n");
+ printf(" 0: Regionless DVDs only\n");
+ printf(" 1: USA, Canada, US Territories\n");
+ printf(" 2: W. Europe, Greenland, S. Africa, Lesotho, "
+ "Swaziland, Japan, Egypt, Mid-East\n");
+ printf(" 3: Southeast Asia, South Korea, Hong Kong, Macau, "
+ "Taiwan\n");
+ printf(" 4: Australia, New Zealand, Oceania, Mexico, Central "
+ "America\n");
+ printf(" 5: Russia (& former Soviet Union), E. Europe, Indian "
+ "subcontinent, Mongolia\n N. Korea, rest of Africa\n");
+ printf(" 6: People's Republic of China\n");
+ printf(" 7: reserved\n");
+ printf(" 8: International Venues\n");
printf("Enter the new region number for your drive [1..8]:");
fgets(ch,3,stdin);
if ((ch[0]<'0') || (ch[0]>'8')) {
@@ -72,7 +91,7 @@
printf("Identical region code already set, aborting!\n");
goto ERROR;
}
- printf("New mask: 0x%02X, correct? [y/n]:",i);
+ printf("New mask: 0x%02X, correct? [y/n]:",i & 0xff);
fgets(ch,3,stdin);
if ((ch[0]=='y') || (ch[0]=='Y')) {
if (UDFRPCSet(i)) {