Author: philippr Date: Sun Jan 20 17:18:41 2008 New Revision: 608 URL: http://svn.gnome.org/viewvc/brasero?rev=608&view=rev
Log: 2008-01-20 Philippe Rouquier <[EMAIL PROTECTED]> Fix #506063 – Brasero fails miserably from burning a file > 4GB We now use iso level 3 and udf when we detect a file > 4GB That means some OS (MacOS X among a couple) may not work * src/brasero-data-disc.c: (brasero_data_disc_reset_real), (brasero_data_disc_restore_unreadable), (brasero_data_disc_file_free), (brasero_data_disc_remove_children_async_cb), (brasero_data_disc_file_new), (brasero_data_disc_symlink_new), (brasero_data_disc_invalid_utf8_new), (brasero_data_disc_dir_contents_end), (brasero_data_disc_delete_row_cb), (brasero_data_disc_path_remove_user), (brasero_data_disc_restore_excluded_children_cb), (brasero_data_disc_new_file), (brasero_data_disc_set_session_param), (brasero_data_disc_inotify_create_paths), (brasero_data_disc_inotify_modify_file_cb), (brasero_data_disc_start_monitoring_real): * src/burn-debug.c: (brasero_debug_data_fs_to_string): * src/burn-track.h: * src/plugins/cdrkit/burn-genisoimage.c: (brasero_genisoimage_set_argv_image), (brasero_genisoimage_export_caps): * src/plugins/cdrtools/burn-mkisofs.c: (brasero_mkisofs_set_argv_image), (brasero_mkisofs_export_caps): * src/plugins/growisofs/burn-growisofs.c: (brasero_growisofs_set_mkisofs_argv), (brasero_growisofs_export_caps): Modified: branches/brasero_0_7/ChangeLog branches/brasero_0_7/src/brasero-data-disc.c branches/brasero_0_7/src/burn-debug.c branches/brasero_0_7/src/burn-track.h branches/brasero_0_7/src/plugins/cdrkit/burn-genisoimage.c branches/brasero_0_7/src/plugins/cdrtools/burn-mkisofs.c branches/brasero_0_7/src/plugins/growisofs/burn-growisofs.c Modified: branches/brasero_0_7/src/brasero-data-disc.c ============================================================================== --- branches/brasero_0_7/src/brasero-data-disc.c (original) +++ branches/brasero_0_7/src/brasero-data-disc.c Sun Jan 20 17:18:41 2008 @@ -195,6 +195,8 @@ GSList *libnotify; guint libnotify_id; + guint G2_files; + gint editing:1; gint is_loading:1; gint reject_files:1; @@ -3244,6 +3246,7 @@ brasero_data_disc_clean (disc); + disc->priv->G2_files = 0; disc->priv->activity_counter = 1; brasero_data_disc_decrease_activity_counter (disc); @@ -3574,6 +3577,11 @@ brasero_data_disc_joliet_incompat_add_paths (disc, paths); } + /* update by the number of non grafted file */ + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files += g_slist_length (paths); + /* now let's see the tree */ for (; paths; paths = g_slist_remove (paths, path)) { path = paths->data; @@ -3799,7 +3807,7 @@ { if (!brasero_data_disc_is_excluded (disc, file->uri, NULL)) { BraseroFile *parent; - char *parent_uri; + gchar *parent_uri; parent_uri = g_path_get_dirname (file->uri); parent = g_hash_table_lookup (disc->priv->dirs, parent_uri); @@ -3810,9 +3818,13 @@ parent->sectors += file->sectors; } - else + else { brasero_data_disc_size_changed (disc, file->sectors * (-1)); + if (file->sectors > 1048576) + disc->priv->G2_files --; + } + brasero_data_disc_file_object_free (disc, file); } @@ -4127,6 +4139,11 @@ /* we update the parent directory */ sectors = GET_SIZE_IN_SECTORS (info->size); + + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files --; + dir->sectors -= sectors; brasero_data_disc_size_changed (disc, sectors * (-1)); @@ -6026,12 +6043,16 @@ #endif brasero_data_disc_size_changed (disc, sectors); } - else if (brasero_data_disc_is_excluded (disc, file->uri, NULL)) + else if (brasero_data_disc_is_excluded (disc, file->uri, NULL)) { brasero_data_disc_size_changed (disc, sectors); + } /* That's mostly when loading a project */ else if (!g_slist_find (disc->priv->loading, parent)) parent->sectors -= sectors; + if (sectors > 1048576) + disc->priv->G2_files ++; + /* because of above we only insert it at the end */ g_hash_table_insert (disc->priv->files, file->uri, file); brasero_data_disc_obj_new (disc, file); @@ -6281,6 +6302,8 @@ info->symlink_name, GET_SIZE_IN_SECTORS (info->size)); + /* No need to check for 2G files here since we set a graft */ + end : uri = entry->uri; @@ -6476,7 +6499,8 @@ g_strdup (uri), sectors); } - + + /* since we graft here no need to check for 2G files */ brasero_data_disc_graft_new (disc, uri, path); grafts = g_slist_prepend (grafts, path); @@ -6586,6 +6610,11 @@ dir_sectors += GET_SIZE_IN_SECTORS (info->size); } + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576 + && !g_hash_table_lookup (disc->priv->files, current)) + disc->priv->G2_files ++; + if (strlen (info->name) > 64) { GSList *paths; @@ -6978,6 +7007,10 @@ return; } + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files --; + sectors = GET_SIZE_IN_SECTORS (info->size); brasero_data_disc_size_changed (disc, sectors * (-1)); parent->sectors -= sectors; @@ -7087,35 +7120,6 @@ /* make an imported session file re-appear if need be */ brasero_data_disc_is_session_path_deleted (disc, path); return; - -#if 0 - BraseroVolFile *file; - - /* could be used the day when a library allows full editing - * of multisession */ - - if (uri != BRASERO_IMPORTED_FILE) - return; - - /* get the volfile and add it to the list of excluded session files */ - file = brasero_volume_file_from_path (path, - disc->priv->session); - if (!file) - return; - - /* update the size */ - brasero_data_disc_size_changed (disc, (-1) * brasero_volume_file_size (file)); - - /* since it could a file with a graft point, it could already be - * in the list. We check that and and eventually add it if it is - * not in this list */ - if (!g_slist_find (disc->priv->session_file_excluded, file)) - disc->priv->session_file_excluded = g_slist_prepend (disc->priv->session_file_excluded, - file); - - return; -#endif - } if (!disc->priv->remove_user) @@ -7423,6 +7427,10 @@ dir = g_hash_table_lookup (disc->priv->dirs, parent); g_free (parent); + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files ++; + dir->sectors += sectors; brasero_data_disc_size_changed (disc, sectors); } @@ -7701,6 +7709,10 @@ parent = g_hash_table_lookup (disc->priv->dirs, parent_uri); g_free (parent_uri); + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY + && GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files ++; + /* no need to check if parent is dummy. It * is done in brasero_data_disc_is_excluded */ sectors = GET_SIZE_IN_SECTORS (info->size); @@ -8895,6 +8907,11 @@ if (!BRASERO_DATA_DISC (disc)->priv->joliet_non_compliant) fs_type |= BRASERO_IMAGE_FS_JOLIET; + /* that's necessary for files > 2Gio. It's supported by all windows, + * linux, only BSD (unsure), and MacOS X don't support it. */ + if (BRASERO_DATA_DISC (disc)->priv->G2_files) + fs_type |= BRASERO_IMAGE_ISO_FS_LEVEL_3 | BRASERO_IMAGE_FS_UDF; + if (brasero_data_disc_is_video_DVD (BRASERO_DATA_DISC (disc))) fs_type |= BRASERO_IMAGE_FS_VIDEO; @@ -11916,6 +11933,9 @@ file = g_hash_table_lookup (disc->priv->dirs, parent); g_free (parent); + if (GET_SIZE_IN_SECTORS (info->size) > 1048576) + disc->priv->G2_files ++; + sectors = GET_SIZE_IN_SECTORS (info->size); file->sectors += sectors; brasero_data_disc_size_changed (disc, sectors); @@ -12215,6 +12235,13 @@ sectors = GET_SIZE_IN_SECTORS (info->size); if (sectors != file->sectors) { + if (info->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { + if (GET_SIZE_IN_SECTORS (info->size) > 1048576 && file->sectors <= 1048576) + disc->priv->G2_files ++; + else if (GET_SIZE_IN_SECTORS (info->size) <= 1048576 && file->sectors > 1048576) + disc->priv->G2_files --; + } + brasero_data_disc_size_changed (disc, sectors - file->sectors); file->sectors = sectors; } @@ -12907,7 +12934,7 @@ brasero_data_disc_start_monitoring_real (BraseroDataDisc *disc, BraseroFile *file) { - const gchar *path; + gchar *path; gint dev_fd; uint32_t mask; Modified: branches/brasero_0_7/src/burn-debug.c ============================================================================== --- branches/brasero_0_7/src/burn-debug.c (original) +++ branches/brasero_0_7/src/burn-debug.c Sun Jan 20 17:18:41 2008 @@ -246,6 +246,8 @@ strcat (buffer, "ISO "); if (fs_type & BRASERO_IMAGE_FS_UDF) strcat (buffer, "UDF "); + if (fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3) + strcat (buffer, "Level 3 "); if (fs_type & BRASERO_IMAGE_FS_JOLIET) strcat (buffer, "JOLIET "); if (fs_type & BRASERO_IMAGE_FS_VIDEO) Modified: branches/brasero_0_7/src/burn-track.h ============================================================================== --- branches/brasero_0_7/src/burn-track.h (original) +++ branches/brasero_0_7/src/burn-track.h Sun Jan 20 17:18:41 2008 @@ -48,9 +48,11 @@ BRASERO_IMAGE_FS_UDF = 1 << 1, BRASERO_IMAGE_FS_JOLIET = 1 << 2, BRASERO_IMAGE_FS_VIDEO = 1 << 3, + BRASERO_IMAGE_ISO_FS_LEVEL_3 = 1 << 4, BRASERO_IMAGE_FS_ANY = BRASERO_IMAGE_FS_ISO| BRASERO_IMAGE_FS_UDF| BRASERO_IMAGE_FS_JOLIET| + BRASERO_IMAGE_ISO_FS_LEVEL_3| BRASERO_IMAGE_FS_VIDEO } BraseroImageFS; Modified: branches/brasero_0_7/src/plugins/cdrkit/burn-genisoimage.c ============================================================================== --- branches/brasero_0_7/src/plugins/cdrkit/burn-genisoimage.c (original) +++ branches/brasero_0_7/src/plugins/cdrkit/burn-genisoimage.c Sun Jan 20 17:18:41 2008 @@ -228,10 +228,22 @@ BRASERO_JOB_NOT_READY (genisoimage); brasero_track_get_type (track, &type); - if ((type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)) + if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) g_ptr_array_add (argv, g_strdup ("-J")); - if ((type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO)) + if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO) + && (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) { + g_ptr_array_add (argv, g_strdup ("-iso-level")); + g_ptr_array_add (argv, g_strdup ("3")); + + /* NOTE the following is specific to genisoimage */ + /* g_ptr_array_add (argv, g_strdup ("-allow-limited-size")); */ + } + + if (type.subtype.fs_type & BRASERO_IMAGE_FS_UDF) + g_ptr_array_add (argv, g_strdup ("-udf")); + + if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) g_ptr_array_add (argv, g_strdup ("-dvd-video")); g_ptr_array_add (argv, g_strdup ("-graft-points")); @@ -488,6 +500,8 @@ BRASERO_BURN_FLAG_NONE); input = brasero_caps_data_new (BRASERO_IMAGE_FS_ISO| + BRASERO_IMAGE_FS_UDF| + BRASERO_IMAGE_ISO_FS_LEVEL_3| BRASERO_IMAGE_FS_JOLIET| BRASERO_IMAGE_FS_VIDEO); Modified: branches/brasero_0_7/src/plugins/cdrtools/burn-mkisofs.c ============================================================================== --- branches/brasero_0_7/src/plugins/cdrtools/burn-mkisofs.c (original) +++ branches/brasero_0_7/src/plugins/cdrtools/burn-mkisofs.c Sun Jan 20 17:18:41 2008 @@ -225,10 +225,19 @@ BRASERO_JOB_NOT_READY (mkisofs); brasero_track_get_type (track, &type); - if ((type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)) + if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) g_ptr_array_add (argv, g_strdup ("-J")); - if ((type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO)) + if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO) + && (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) { + g_ptr_array_add (argv, g_strdup ("-iso-level")); + g_ptr_array_add (argv, g_strdup ("3")); + } + + if (type.subtype.fs_type & BRASERO_IMAGE_FS_UDF) + g_ptr_array_add (argv, g_strdup ("-udf")); + + if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) g_ptr_array_add (argv, g_strdup ("-dvd-video")); g_ptr_array_add (argv, g_strdup ("-graft-points")); @@ -484,6 +493,8 @@ BRASERO_BURN_FLAG_NONE); input = brasero_caps_data_new (BRASERO_IMAGE_FS_ISO| + BRASERO_IMAGE_FS_UDF| + BRASERO_IMAGE_ISO_FS_LEVEL_3| BRASERO_IMAGE_FS_JOLIET| BRASERO_IMAGE_FS_VIDEO); Modified: branches/brasero_0_7/src/plugins/growisofs/burn-growisofs.c ============================================================================== --- branches/brasero_0_7/src/plugins/growisofs/burn-growisofs.c (original) +++ branches/brasero_0_7/src/plugins/growisofs/burn-growisofs.c Sun Jan 20 17:18:41 2008 @@ -240,6 +240,17 @@ if (input.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) g_ptr_array_add (argv, g_strdup ("-J")); + if ((input.subtype.fs_type & BRASERO_IMAGE_FS_ISO) + && (input.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) { + /* That's the safest option. A few OS don't support that though, + * like MacOSX and freebsd.*/ + g_ptr_array_add (argv, g_strdup ("-iso-level")); + g_ptr_array_add (argv, g_strdup ("3")); + } + + if (input.subtype.fs_type & BRASERO_IMAGE_FS_UDF) + g_ptr_array_add (argv, g_strdup ("-udf")); + if (input.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) g_ptr_array_add (argv, g_strdup ("-dvd-video")); @@ -688,6 +699,8 @@ BRASERO_MEDIUM_HAS_DATA); input = brasero_caps_data_new (BRASERO_IMAGE_FS_ISO| + BRASERO_IMAGE_FS_UDF| + BRASERO_IMAGE_ISO_FS_LEVEL_3| BRASERO_IMAGE_FS_JOLIET| BRASERO_IMAGE_FS_VIDEO); _______________________________________________ SVN-commits-list mailing list (read only) http://mail.gnome.org/mailman/listinfo/svn-commits-list Want to limit the commits to a few modules? Go to above URL, log in to edit your options and select the modules ('topics') you want. Module maintainer? It is possible to set the reply-to to your development mailing list. Email [EMAIL PROTECTED] if interested.