Imported Upstream version 0.79.2

This commit is contained in:
Rogério Brito
2010-11-06 20:36:40 -02:00
committed by TANIGUCHI Takaki
parent c3da7b4a44
commit bfe15b23fb
855 changed files with 28909 additions and 12770 deletions

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
*
@@ -125,12 +125,16 @@ static void abort_encoding(ecc_closure *ec, int truncate)
static void remove_old_ecc(ecc_closure *ec)
{ EccHeader *old_eh;
LargeFile *tmp;
old_eh = FindHeaderInImage(Closure->imageName);
tmp = LargeOpen(Closure->imageName, O_RDWR, IMG_PERMS);
if(!tmp)
return; /* no image file at all */
old_eh = FindRS02HeaderInImage(tmp);
if(old_eh)
{ gint64 data_sectors = uchar_to_gint64(old_eh->sectors);
LargeFile *tmp;
int answer;
g_free(old_eh);
@@ -143,11 +147,11 @@ static void remove_old_ecc(ecc_closure *ec)
if(!answer)
abort_encoding(ec, FALSE);
tmp = LargeOpen(Closure->imageName, O_RDWR, IMG_PERMS);
if(!tmp || !LargeTruncate(tmp, (gint64)(2048*data_sectors)))
Stop(_("Could not truncate %s: %s\n"),Closure->imageName,strerror(errno));
LargeClose(tmp);
}
LargeClose(tmp);
}
/*
@@ -1062,8 +1066,7 @@ void RS02Create(Method *method)
Stop(_("Not enough space on medium left for error correction data.\n"
"Data portion of image: %lld sect.; maximum possible size: %lld sect.\n"
"If reducing the image size or using a larger medium is\n"
"not an option, please create a separate error correction\n"
"file using the RS01 method.\n"),
"not an option, please create a separate error correction file."),
lay->dataSectors, lay->mediumCapacity);
if(lay->redundancy < 20)