Imported Upstream version 0.79.2

This commit is contained in:
Rogério Brito
2010-11-06 20:36:40 -02:00
parent 294f8623c4
commit 555c0daf7d
855 changed files with 28909 additions and 12770 deletions

45
udf.c
View File

@@ -1,5 +1,5 @@
/* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2009 Carsten Gnoerlich.
* Copyright (C) 2004-2010 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
*
@@ -130,10 +130,9 @@ static int try_sector(DeviceHandle *dh, gint64 pos, EccHeader **ehptr, unsigned
static void no_rs02_cb(GtkWidget *widget, gpointer data)
{ int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
if(state) Closure->querySize = 1;
else Closure->querySize = 2;
Closure->examineRS02 = !state;
UpdatePrefsQuerySize();
UpdatePrefsExhaustiveSearch();
}
static void insert_buttons(GtkDialog *dialog)
@@ -167,7 +166,6 @@ EccHeader* FindHeaderInMedium(DeviceHandle *dh, gint64 max_sectors)
gint64 header_modulo;
int read_count = 0;
int answered_continue = FALSE;
int warning_shown = FALSE;
/*** Quick search at fixed offsets relative to ISO filesystem */
@@ -245,13 +243,6 @@ EccHeader* FindHeaderInMedium(DeviceHandle *dh, gint64 max_sectors)
if(answer) goto bail_out;
answered_continue = TRUE;
}
if(!Closure->guiMode && !warning_shown)
{ PrintCLI(_("\nSearching this medium for error correction data may take a long time.\n"
"If you are certain that this medium was not augmented with RS02 error correction\n"
"data, you might wish to abort this command and re-run with the option\n"
"--query-size=udf\n"));
warning_shown = TRUE;
}
}
goto check_next_header;
case TRY_NEXT_MODULO:
@@ -627,7 +618,7 @@ static IsoInfo* examine_primary_vd(unsigned char *buf)
return ii;
}
static IsoInfo* examine_iso(DeviceHandle *dh)
static IsoInfo* examine_iso(DeviceHandle *dh, LargeFile *image)
{ AlignedBuffer *ab = CreateAlignedBuffer(2048);
unsigned char *buf = ab->buf;
IsoInfo *ii = NULL;
@@ -638,12 +629,19 @@ static IsoInfo* examine_iso(DeviceHandle *dh)
Verbose(" Examining the ISO file system...\n");
/*** Iterate over the volume decriptors */
if(image)
if(!LargeSeek(image, 2048*16))
{ Verbose(" * Could not seek to sector 16");
return NULL;
}
for(sector=16; sector<32; sector++)
{ if(Closure->stopActions)
continue;
status = ReadSectorsFast(dh, buf, sector, 1);
if(dh) status = ReadSectorsFast(dh, buf, sector, 1);
else status = !LargeRead(image, buf, 2048);
if(status)
{ Verbose(" Sector %2d: unreadable\n", sector);
@@ -692,20 +690,27 @@ finished:
***/
int ExamineUDF(DeviceHandle *dh)
{
Verbose("\nExamineUDF(%s)\n",dh->devinfo);
IsoInfo* ExamineUDF(DeviceHandle *dh, LargeFile *image)
{ IsoInfo *ii;
dh->isoInfo = examine_iso(dh);
if(!dh && !image) return NULL;
if(dh) Verbose("\nExamineUDF(Device: %s)\n", dh->devinfo);
if(image) Verbose("\nExamineUDF(File: %s)\n", image->path);
ii = examine_iso(dh, image);
if(dh) dh->isoInfo = ii;
Verbose(" Examining the UDF file system...\n");
Verbose(" not yet implemented.\n\n");
/* Try to find the root header at a fixed offset to the ISO filesystem end. */
dh->rs02Size = MediumLengthFromRS02(dh, 0);
if(dh)
dh->rs02Size = MediumLengthFromRS02(dh, 0);
return TRUE;
return ii;
}
/***