brasero r1789 - in trunk: . libbrasero-media src src/plugins/checksum
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1789 - in trunk: . libbrasero-media src src/plugins/checksum
- Date: Mon, 19 Jan 2009 08:21:38 +0000 (UTC)
Author: philippr
Date: Mon Jan 19 08:21:38 2009
New Revision: 1789
URL: http://svn.gnome.org/viewvc/brasero?rev=1789&view=rev
Log:
2009-01-19 Philippe Rouquier <ykw localhost localdomain>
Some more debug statements for errors in drive probing code
Save drive rates more properly
* libbrasero-media/brasero-medium.c
(brasero_medium_get_speed_mmc3),
(brasero_medium_get_page_2A_write_speed_desc),
(brasero_medium_get_page_2A_max_speed),
(brasero_medium_check_old_drive):
* src/brasero-session-cfg.c
(brasero_session_cfg_save_drive_properties),
(brasero_session_cfg_set_drive_properties):
Modified:
trunk/ChangeLog
trunk/libbrasero-media/brasero-medium.c
trunk/src/brasero-session-cfg.c
trunk/src/plugins/checksum/burn-volume-read.c
trunk/src/plugins/checksum/burn-volume-read.h
Modified: trunk/libbrasero-media/brasero-medium.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium.c (original)
+++ trunk/libbrasero-media/brasero-medium.c Mon Jan 19 08:21:38 2009
@@ -1287,6 +1287,8 @@
priv->max_rd = max_rd;
priv->max_wrt = max_wrt;
+ BRASERO_MEDIA_LOG ("Maximum Speed (mmc3) %i", max_wrt);
+
end:
g_free (wrt_perf);
@@ -1364,6 +1366,8 @@
else
priv->max_wrt = max_wrt;
+ BRASERO_MEDIA_LOG ("Maximum Speed (Page 2A) %i", priv->max_wrt);
+
priv->max_rd = BRASERO_GET_16 (page_2A->rd_max_speed);
g_free (data);
@@ -1409,6 +1413,8 @@
priv->max_rd = BRASERO_GET_16 (page_2A->rd_max_speed);
priv->max_wrt = BRASERO_GET_16 (page_2A->wr_max_speed);
+ BRASERO_MEDIA_LOG ("Maximum Speed (Page 2A [old]) %i", priv->max_wrt);
+
/* also add it to the speed descriptors */
priv->wr_speeds = g_new0 (gint, 2);
priv->wr_speeds [0] = BRASERO_GET_16 (page_2A->wr_max_speed);
@@ -2624,6 +2630,8 @@
g_free (model);
priv->max_rd = BRASERO_SPEED_TO_RATE_CD (12);
priv->max_wrt = BRASERO_SPEED_TO_RATE_CD (4);
+ BRASERO_MEDIA_LOG ("Maximum Speed (old drive) %i", priv->max_wrt);
+
return brasero_medium_old_drive_get_disc_info (self,
handle,
code);
Modified: trunk/src/brasero-session-cfg.c
==============================================================================
--- trunk/src/brasero-session-cfg.c (original)
+++ trunk/src/brasero-session-cfg.c Mon Jan 19 08:21:38 2009
@@ -203,7 +203,7 @@
return;
}
- gconf_client_set_int (client, key, rate / 1024, NULL);
+ gconf_client_set_int (client, key, rate / 1000, NULL);
g_free (key);
key = brasero_session_cfg_get_gconf_key (self, "flags");
@@ -364,7 +364,7 @@
g_free (key);
if (value) {
- rate = gconf_value_get_int (value) * 1024;
+ rate = gconf_value_get_int (value) * 1000;
gconf_value_free (value);
}
else
Modified: trunk/src/plugins/checksum/burn-volume-read.c
==============================================================================
--- trunk/src/plugins/checksum/burn-volume-read.c (original)
+++ trunk/src/plugins/checksum/burn-volume-read.c Mon Jan 19 08:21:38 2009
@@ -57,24 +57,13 @@
g_free (handle);
}
-BraseroVolFileHandle *
-brasero_volume_file_open (BraseroVolSrc *src,
- BraseroVolFile *file)
+static gboolean
+brasero_volume_file_rewind_real (BraseroVolFileHandle *handle)
{
- BraseroVolFileHandle *handle;
- BraseroVolFileExtent *extent;
- gboolean result;
- gint res_seek;
GSList *node;
-
- if (file->isdir)
- return NULL;
-
- handle = g_new0 (BraseroVolFileHandle, 1);
- handle->src = src;
- brasero_volume_source_ref (src);
-
- handle->extents_forward = g_slist_copy (file->specific.file.extents);
+ gint res_seek;
+ gboolean result;
+ BraseroVolFileExtent *extent;
node = handle->extents_forward;
extent = node->data;
@@ -89,16 +78,12 @@
/* start loading first block */
res_seek = BRASERO_VOL_SRC_SEEK (handle->src, handle->position, SEEK_SET, NULL);
- if (res_seek == -1) {
- brasero_volume_file_close (handle);
- return NULL;
- }
+ if (res_seek == -1)
+ return FALSE;
result = BRASERO_VOL_SRC_READ (handle->src, (gchar *) handle->buffer, 1, NULL);
- if (!result) {
- brasero_volume_file_close (handle);
- return NULL;
- }
+ if (!result)
+ return FALSE;
handle->offset = 0;
handle->position ++;
@@ -108,9 +93,47 @@
else
handle->buffer_max = sizeof (handle->buffer);
+ return TRUE;
+}
+
+BraseroVolFileHandle *
+brasero_volume_file_open (BraseroVolSrc *src,
+ BraseroVolFile *file)
+{
+ BraseroVolFileHandle *handle;
+
+ if (file->isdir)
+ return NULL;
+
+ handle = g_new0 (BraseroVolFileHandle, 1);
+ handle->src = src;
+ brasero_volume_source_ref (src);
+
+ handle->extents_forward = g_slist_copy (file->specific.file.extents);
+ if (brasero_volume_file_rewind_real (handle)) {
+ brasero_volume_file_close (handle);
+ return NULL;
+ }
+
return handle;
}
+gboolean
+brasero_volume_file_rewind (BraseroVolFileHandle *handle)
+{
+ GSList *node, *next;
+
+ /* Put back all extents in the unread list */
+ for (node = handle->extents_backward; node; node = next) {
+ next = node->next;
+ handle->extents_backward = g_slist_remove_link (handle->extents_backward, node);
+
+ node->next = handle->extents_forward;
+ handle->extents_forward = node;
+ }
+ return brasero_volume_file_rewind (handle);
+}
+
BraseroBurnResult
brasero_volume_file_check_state (BraseroVolFileHandle *handle)
{
@@ -215,17 +238,22 @@
line_len = break_line - (handle->buffer + handle->offset);
if (line_len >= len) {
/* - 1 is to be able to set last character to '\0' */
- memcpy (buffer + buffer_offset,
- handle->buffer + handle->offset,
- len - buffer_offset - 1);
+ if (buffer) {
+ memcpy (buffer + buffer_offset,
+ handle->buffer + handle->offset,
+ len - buffer_offset - 1);
+
+ buffer [len - 1] = '\0';
+ }
- buffer [len - 1] = '\0';
handle->offset += len - buffer_offset - 1;
return TRUE;
}
- memcpy (buffer, handle->buffer + handle->offset, line_len);
- buffer [line_len] = '\0';
+ if (buffer) {
+ memcpy (buffer, handle->buffer + handle->offset, line_len);
+ buffer [line_len] = '\0';
+ }
/* add 1 to skip the line break */
handle->offset += line_len + 1;
@@ -255,9 +283,10 @@
BraseroScsiResult result;
/* copy what we already have in the buffer. */
- memcpy (buffer + buffer_offset,
- handle->offset + handle->buffer,
- handle->buffer_max - handle->offset);
+ if (buffer)
+ memcpy (buffer + buffer_offset,
+ handle->offset + handle->buffer,
+ handle->buffer_max - handle->offset);
buffer_offset += handle->buffer_max - handle->offset;
handle->offset = handle->buffer_max;
@@ -277,12 +306,14 @@
return brasero_volume_file_check_state (handle);
}
- memcpy (buffer + buffer_offset,
- handle->buffer + handle->offset,
- len - buffer_offset - 1);
-
/* we filled the buffer */
- buffer [len - 1] = '\0';
+ if (buffer) {
+ memcpy (buffer + buffer_offset,
+ handle->buffer + handle->offset,
+ len - buffer_offset - 1);
+ buffer [len - 1] = '\0';
+ }
+
handle->offset += len - buffer_offset - 1;
return brasero_volume_file_check_state (handle);
Modified: trunk/src/plugins/checksum/burn-volume-read.h
==============================================================================
--- trunk/src/plugins/checksum/burn-volume-read.h (original)
+++ trunk/src/plugins/checksum/burn-volume-read.h Mon Jan 19 08:21:38 2009
@@ -35,6 +35,7 @@
typedef struct _BraseroVolFileHandle BraseroVolFileHandle;
+
BraseroVolFileHandle *
brasero_volume_file_open (BraseroVolSrc *src,
BraseroVolFile *file);
@@ -42,6 +43,8 @@
void
brasero_volume_file_close (BraseroVolFileHandle *handle);
+gboolean
+brasero_volume_file_rewind (BraseroVolFileHandle *handle);
gint
brasero_volume_file_read (BraseroVolFileHandle *handle,
@@ -49,7 +52,7 @@
guint len);
BraseroBurnResult
-brasero_volume_file_read_line (BraseroVolFileHandle *hanlde,
+brasero_volume_file_read_line (BraseroVolFileHandle *handle,
gchar *buffer,
guint len);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]