brasero r1510 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1510 - in trunk: . src
- Date: Mon, 10 Nov 2008 15:04:38 +0000 (UTC)
Author: philippr
Date: Mon Nov 10 15:04:37 2008
New Revision: 1510
URL: http://svn.gnome.org/viewvc/brasero?rev=1510&view=rev
Log:
Fix for
#557561 â Brasero don\'t recognize empty disk
#556449 â Session error : Insufficient space on media when copying an audio CD (same problem with trunk)
* src/burn-medium.c (brasero_medium_track_set_leadout_CDR_blank),
(brasero_medium_track_set_leadout):
* src/scsi-write-page.h:
Modified:
trunk/ChangeLog
trunk/src/burn-medium.c
trunk/src/scsi-write-page.h
Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c (original)
+++ trunk/src/burn-medium.c Mon Nov 10 15:04:37 2008
@@ -1498,6 +1498,46 @@
}
static BraseroBurnResult
+brasero_medium_track_set_leadout_CDR_blank (BraseroMedium *self,
+ BraseroDeviceHandle *handle,
+ BraseroMediumTrack *leadout,
+ BraseroScsiErrCode *code)
+{
+ BraseroScsiAtipData *atip = NULL;
+ BraseroMediumPrivate *priv;
+ BraseroScsiResult result;
+ int size = 0;
+
+ priv = BRASERO_MEDIUM_PRIVATE (self);
+
+ BRASERO_BURN_LOG ("Using fallback method for blank CDR to retrieve NWA and leadout information");
+
+ /* NWA is easy for blank CDRs, it's 0. So far, so good... */
+ priv->next_wr_add = 0;
+
+ result = brasero_mmc1_read_atip (handle, &atip, &size, code);
+ if (result != BRASERO_SCSI_OK) {
+ BRASERO_BURN_LOG ("READ ATIP failed");
+ return BRASERO_BURN_ERR;
+ }
+
+ leadout->blocks_num = atip->desc->leadout_mn * 60 * 75 +
+ atip->desc->leadout_sec * 75 +
+ atip->desc->leadout_frame;
+
+ /* of course it starts at 0 since it's empty */
+ leadout->start = 0;
+
+ BRASERO_BURN_LOG ("Leadout (through READ ATIP): start = %llu size = %llu",
+ leadout->start,
+ leadout->blocks_num);
+
+ g_free (atip);
+
+ return BRASERO_BURN_OK;
+}
+
+static BraseroBurnResult
brasero_medium_track_set_leadout (BraseroMedium *self,
BraseroDeviceHandle *handle,
BraseroMediumTrack *leadout,
@@ -1531,8 +1571,25 @@
if (result == BRASERO_SCSI_OK) {
wrt_page = (BraseroScsiWritePage *) &data->page;
- BRASERO_BURN_LOG ("Former write mode %d", wrt_page->write_type);
+ BRASERO_BURN_LOG ("Former write type %d", wrt_page->write_type);
+ BRASERO_BURN_LOG ("Former track mode %d", wrt_page->track_mode);
+ BRASERO_BURN_LOG ("Former data block type %d", wrt_page->data_block_type);
+
+ /* "reset some stuff to be on the safe side" (words and ideas
+ * taken from k3b:)). */
+ wrt_page->ps = 0;
+ wrt_page->BUFE = 0;
+ wrt_page->multisession = 0;
+ wrt_page->testwrite = 0;
+ wrt_page->LS_V = 0;
+ wrt_page->copy = 0;
+ wrt_page->FP = 0;
+ wrt_page->session_format = 0;
+ BRASERO_SET_16 (wrt_page->pause_len, 150);
+
wrt_page->write_type = BRASERO_SCSI_WRITE_TAO;
+ wrt_page->track_mode = 4; /* should be 5 for DVD-R(W) */
+ wrt_page->data_block_type = 8;
result = brasero_spc1_mode_select (handle, data, size, code);
g_free (data);
@@ -1540,6 +1597,13 @@
if (result != BRASERO_SCSI_OK) {
BRASERO_BURN_LOG ("MODE SELECT failed");
+ /* This only for CD-R */
+ if (BRASERO_MEDIUM_IS (priv->info, BRASERO_MEDIUM_CDR|BRASERO_MEDIUM_BLANK))
+ return brasero_medium_track_set_leadout_CDR_blank (self,
+ handle,
+ leadout,
+ code);
+
/* This isn't necessarily a problem! we better try */
// return BRASERO_BURN_ERR;
}
@@ -1547,6 +1611,13 @@
else {
BRASERO_BURN_LOG ("MODE SENSE failed");
+ /* This only for CD-R */
+ if (BRASERO_MEDIUM_IS (priv->info, BRASERO_MEDIUM_CDR|BRASERO_MEDIUM_BLANK))
+ return brasero_medium_track_set_leadout_CDR_blank (self,
+ handle,
+ leadout,
+ code);
+
/* This isn't necessarily a problem we better! try the rest */
// return BRASERO_BURN_ERR;
}
@@ -1580,6 +1651,13 @@
code);
if (result != BRASERO_SCSI_OK) {
+ /* This only for CD-R */
+ if (BRASERO_MEDIUM_IS (priv->info, BRASERO_MEDIUM_CDR|BRASERO_MEDIUM_BLANK))
+ return brasero_medium_track_set_leadout_CDR_blank (self,
+ handle,
+ leadout,
+ code);
+
BRASERO_BURN_LOG ("READ TRACK INFO failed");
return BRASERO_BURN_ERR;
}
Modified: trunk/src/scsi-write-page.h
==============================================================================
--- trunk/src/scsi-write-page.h (original)
+++ trunk/src/scsi-write-page.h Mon Nov 10 15:04:37 2008
@@ -51,7 +51,7 @@
uchar FP :1;
uchar multisession :2;
- uchar book_type :4;
+ uchar data_block_type :4;
uchar reserved2 :4;
uchar link_size;
@@ -102,7 +102,7 @@
uchar track_mode :4;
uchar reserved2 :4;
- uchar book_type :4;
+ uchar data_block_type :4;
uchar link_size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]