brasero r870 - in trunk: . src src/plugins/cdrkit src/plugins/cdrtools src/plugins/growisofs
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r870 - in trunk: . src src/plugins/cdrkit src/plugins/cdrtools src/plugins/growisofs
- Date: Sun, 8 Jun 2008 16:08:07 +0000 (UTC)
Author: philippr
Date: Sun Jun 8 16:08:07 2008
New Revision: 870
URL: http://svn.gnome.org/viewvc/brasero?rev=870&view=rev
Log:
Fix #493495 â Growisofs stops while burning Video-DVD
* src/brasero-data-project.c
(brasero_data_project_is_video_project):
* src/brasero-project-manager.c (brasero_project_manager_open_uri):
* src/burn-mkisofs-base.c (brasero_mkisofs_base_write_graft),
(brasero_mkisofs_base_process_video_graft),
(brasero_mkisofs_base_add_graft),
(brasero_mkisofs_base_write_to_files):
* src/burn-mkisofs-base.h:
* src/burn-session.c (brasero_burn_session_clean_directory),
(brasero_burn_session_clean), (brasero_burn_session_finalize):
* src/burn-track.c (brasero_track_get_data_paths):
* src/burn-track.h:
* src/plugins/cdrkit/burn-genisoimage.c
(brasero_genisoimage_set_argv_image):
* src/plugins/cdrtools/burn-mkisofs.c
(brasero_mkisofs_set_argv_image):
* src/plugins/growisofs/burn-growisofs.c
(brasero_growisofs_set_mkisofs_argv):
Modified:
trunk/ChangeLog
trunk/src/brasero-data-project.c
trunk/src/brasero-project-manager.c
trunk/src/burn-mkisofs-base.c
trunk/src/burn-mkisofs-base.h
trunk/src/burn-session.c
trunk/src/burn-track.c
trunk/src/burn-track.h
trunk/src/plugins/cdrkit/burn-genisoimage.c
trunk/src/plugins/cdrtools/burn-mkisofs.c
trunk/src/plugins/growisofs/burn-growisofs.c
Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c (original)
+++ trunk/src/brasero-data-project.c Sun Jun 8 16:08:07 2008
@@ -2300,9 +2300,9 @@
if (!strcmp (name, "VIDEO_TS")) {
BraseroFileNode *child;
- gboolean has_ifo, has_vob, has_bup;
+ gboolean has_ifo, has_bup;
- has_ifo = has_vob = has_bup = FALSE;
+ has_ifo = has_bup = FALSE;
child = BRASERO_FILE_NODE_CHILDREN (iter);
for (; child; child = child->next) {
@@ -2312,13 +2312,11 @@
if (!strcmp (name, "VIDEO_TS.IFO"))
has_ifo = TRUE;
- else if (!strcmp (name, "VIDEO_TS.VOB"))
- has_vob = TRUE;
else if (!strcmp (name, "VIDEO_TS.BUP"))
has_bup = TRUE;
}
- if (!has_ifo || !has_vob || !has_bup)
+ if (!has_ifo || !has_bup)
return FALSE;
has_video = TRUE;
Modified: trunk/src/brasero-project-manager.c
==============================================================================
--- trunk/src/brasero-project-manager.c (original)
+++ trunk/src/brasero-project-manager.c Sun Jun 8 16:08:07 2008
@@ -755,7 +755,6 @@
gchar *uri;
GFile *file;
GFileInfo *info;
- GCancellable *cancellable;
const gchar *mime;
BraseroProjectType type;
@@ -779,7 +778,9 @@
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Error loading project");
- gtk_message_dialog_format_secondary_text (dialog, _("The project '%s' does not exist."), uri);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("The project '%s' does not exist."),
+ uri);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
Modified: trunk/src/burn-mkisofs-base.c
==============================================================================
--- trunk/src/burn-mkisofs-base.c (original)
+++ trunk/src/burn-mkisofs-base.c Sun Jun 8 16:08:07 2008
@@ -46,11 +46,14 @@
struct _BraseroMkisofsBase {
const gchar *emptydir;
+ const gchar *videodir;
gint grafts_fd;
gint excluded_fd;
GHashTable *grafts;
+
+ guint found_video_ts:1;
};
typedef struct _BraseroMkisofsBase BraseroMkisofsBase;
@@ -271,7 +274,7 @@
result = _write_line (base->grafts_fd, graft_point, error);
g_free (graft_point);
- if(result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK)
return result;
return BRASERO_BURN_OK;
@@ -298,7 +301,7 @@
return FALSE;
}
-static gboolean
+static BraseroBurnResult
brasero_mkisofs_base_write_grafts (BraseroMkisofsBase *base,
GError **error)
{
@@ -336,6 +339,54 @@
}
static BraseroBurnResult
+brasero_mkisofs_base_process_video_graft (BraseroMkisofsBase *base,
+ BraseroGraftPt *graft,
+ GError **error)
+{
+ gchar *link_path;
+ gchar *path;
+ int res;
+
+ path = g_filename_from_uri (graft->uri, NULL, NULL);
+ if (g_str_has_suffix (path, G_DIR_SEPARATOR_S)) {
+ gchar *tmp;
+
+ tmp = g_strndup (path, strlen (path) - strlen (G_DIR_SEPARATOR_S));
+ g_free (path);
+ path = tmp;
+ }
+
+ link_path = g_build_path (G_DIR_SEPARATOR_S,
+ base->videodir,
+ graft->path,
+ NULL);
+
+ if (g_str_has_suffix (link_path, G_DIR_SEPARATOR_S)) {
+ gchar *tmp;
+
+ tmp = g_strndup (link_path, strlen (link_path) - strlen (G_DIR_SEPARATOR_S));
+ g_free (link_path);
+ link_path = tmp;
+ }
+
+ BRASERO_BURN_LOG ("Linking %s to %s", link_path, path);
+ res = symlink (path, link_path);
+
+ g_free (path);
+ g_free (link_path);
+
+ if (res) {
+ g_set_error (error,
+ BRASERO_BURN_ERROR,
+ BRASERO_BURN_ERROR_GENERAL,
+ strerror (errno));
+ return BRASERO_BURN_ERR;
+ }
+
+ return BRASERO_BURN_OK;
+}
+
+static BraseroBurnResult
brasero_mkisofs_base_add_graft (BraseroMkisofsBase *base,
BraseroGraftPt *graft,
GError **error)
@@ -352,7 +403,38 @@
return BRASERO_BURN_ERR;
}
- /* make up the graft point */
+ /* This is a special case for VIDEO images. Given the tests I performed,
+ * the option --dvd-video requires the parent directory of VIDEO_TS and
+ * AUDIO_TS to be passed. If each of these two directories are passed
+ * as an option it will fail.
+ * One workaround is to create a fake directory for VIDEO_TS and
+ * AUDIO_TS and add hardlinks inside pointing to these two directories.
+ * As this parent directory is a temporary directory it must have been
+ * passed by the calling plugins. */
+ if (base->videodir) {
+ BraseroBurnResult res;
+
+ /* try with "VIDEO_TS", "VIDEO_TS/", "VIDEO_TS/" and "/VIDEO_TS/"
+ * to make sure we don't miss one */
+ if (!strcmp (graft->path , "VIDEO_TS")
+ || !strcmp (graft->path , "/VIDEO_TS")
+ || !strcmp (graft->path , "VIDEO_TS/")
+ || !strcmp (graft->path , "/VIDEO_TS/")) {
+ res = brasero_mkisofs_base_process_video_graft (base, graft, error);
+ if (res != BRASERO_BURN_OK)
+ return res;
+
+ base->found_video_ts = TRUE;
+ return BRASERO_BURN_OK;
+ }
+ else if (!strcmp (graft->path , "AUDIO_TS")
+ || !strcmp (graft->path , "/AUDIO_TS")
+ || !strcmp (graft->path , "AUDIO_TS/")
+ || !strcmp (graft->path , "/AUDIO_TS/"))
+ return brasero_mkisofs_base_process_video_graft (base, graft, error);
+ }
+
+ /* add the graft point */
list = g_hash_table_lookup (base->grafts, graft->uri);
if (list)
g_hash_table_steal (base->grafts, graft->uri);
@@ -367,6 +449,7 @@
brasero_mkisofs_base_write_to_files (GSList *grafts,
GSList *excluded,
const gchar *emptydir,
+ const gchar *videodir,
const gchar *grafts_path,
const gchar *excluded_path,
GError **error)
@@ -399,6 +482,7 @@
}
base.emptydir = emptydir;
+ base.videodir = videodir;
base.grafts = g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -408,8 +492,8 @@
/* we analyse the graft points:
* first add graft points and excluded. At the same time create a hash
* table in which key = uri and value = graft points, a list of all
- * the uris that have been excluded and a hash for non local files.
- * once finished, for each excluded use the hash to see if there are not
+ * the uris that have been excluded.
+ * Once finished, for each excluded use the hash to see if there are not
* other paths at which the excluded uri must appear. If so, create an
* explicit graft point. */
grafts_excluded = NULL;
@@ -418,6 +502,8 @@
graft = grafts->data;
+ BRASERO_BURN_LOG ("New graft %s %s", graft->uri, graft->path);
+
if (!graft->uri) {
result = brasero_mkisofs_base_empty_directory (&base,
graft->path,
@@ -435,6 +521,15 @@
goto cleanup;
}
+ /* simple check */
+ if (base.videodir && !base.found_video_ts) {
+ g_set_error (error,
+ BRASERO_BURN_ERROR,
+ BRASERO_BURN_ERROR_GENERAL,
+ _("VIDEO_TS directory is missing or invalid"));
+ return BRASERO_BURN_ERR;
+ }
+
/* write the grafts list */
result = brasero_mkisofs_base_write_grafts (&base, error);
if (result != BRASERO_BURN_OK)
Modified: trunk/src/burn-mkisofs-base.h
==============================================================================
--- trunk/src/burn-mkisofs-base.h (original)
+++ trunk/src/burn-mkisofs-base.h Sun Jun 8 16:08:07 2008
@@ -37,6 +37,7 @@
brasero_mkisofs_base_write_to_files (GSList *grafts,
GSList *excluded,
const gchar *emptydir,
+ const gchar *videodir,
const gchar *grafts_path,
const gchar *excluded_path,
GError **error);
Modified: trunk/src/burn-session.c
==============================================================================
--- trunk/src/burn-session.c (original)
+++ trunk/src/burn-session.c Sun Jun 8 16:08:07 2008
@@ -1662,6 +1662,64 @@
g_slist_free (list);
}
+/**
+ * Utility to clean tmp files
+ */
+
+static gboolean
+brasero_burn_session_clean (const gchar *path);
+
+static gboolean
+brasero_burn_session_clean_directory (const gchar *path)
+{
+ GDir *dir;
+ const gchar *name;
+
+ dir = g_dir_open (path, 0, NULL);
+ if (!dir)
+ return FALSE;
+
+ while ((name = g_dir_read_name (dir))) {
+ gchar *tmp;
+
+ tmp = g_build_filename (G_DIR_SEPARATOR_S,
+ path,
+ name,
+ NULL);
+
+ if (!brasero_burn_session_clean (tmp)) {
+ g_dir_close (dir);
+ g_free (tmp);
+ return FALSE;
+ }
+
+ g_free (tmp);
+ }
+
+ g_dir_close (dir);
+ return TRUE;
+}
+
+static gboolean
+brasero_burn_session_clean (const gchar *path)
+{
+ gboolean result = TRUE;
+
+ if (!path)
+ return TRUE;
+
+ if (g_file_test (path, G_FILE_TEST_IS_DIR))
+ brasero_burn_session_clean_directory (path);
+
+ /* NOTE : we don't follow uris as certain files are simply linked by content-data */
+ if (g_remove (path)) {
+ BRASERO_BURN_LOG ("Cannot remove file %s", path);
+ result = FALSE;
+ }
+
+ return result;
+}
+
static void
brasero_burn_session_finalize (GObject *object)
{
@@ -1720,7 +1778,7 @@
tmpfile = iter->data;
- g_remove (tmpfile);
+ brasero_burn_session_clean (tmpfile);
g_free (tmpfile);
}
g_slist_free (priv->tmpfiles);
Modified: trunk/src/burn-track.c
==============================================================================
--- trunk/src/burn-track.c (original)
+++ trunk/src/burn-track.c Sun Jun 8 16:08:07 2008
@@ -785,6 +785,7 @@
const gchar *grafts_path,
const gchar *excluded_path,
const gchar *emptydir,
+ const gchar *videodir,
GError **error)
{
BraseroBurnResult result;
@@ -797,6 +798,7 @@
result = brasero_mkisofs_base_write_to_files (data->grafts,
data->excluded,
emptydir,
+ videodir,
grafts_path,
excluded_path,
error);
Modified: trunk/src/burn-track.h
==============================================================================
--- trunk/src/burn-track.h (original)
+++ trunk/src/burn-track.h Sun Jun 8 16:08:07 2008
@@ -239,6 +239,7 @@
const gchar *grafts_path,
const gchar *excluded_path,
const gchar *emptydir,
+ const gchar *videodir,
GError **error);
gchar *
Modified: trunk/src/plugins/cdrkit/burn-genisoimage.c
==============================================================================
--- trunk/src/plugins/cdrkit/burn-genisoimage.c (original)
+++ trunk/src/plugins/cdrkit/burn-genisoimage.c Sun Jun 8 16:08:07 2008
@@ -215,6 +215,7 @@
BraseroTrackType type;
BraseroBurnFlag flags;
gchar *emptydir = NULL;
+ gchar *videodir = NULL;
BraseroBurnResult result;
BraseroJobAction action;
gchar *grafts_path = NULL;
@@ -243,9 +244,16 @@
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)
+ if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
+ result = brasero_job_get_tmp_dir (BRASERO_JOB (genisoimage),
+ &videodir,
+ error);
+ if (result != BRASERO_BURN_OK)
+ return result;
+ }
+
g_ptr_array_add (argv, g_strdup ("-graft-points"));
if (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
@@ -255,14 +263,17 @@
NULL,
&grafts_path,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
return result;
+ }
result = brasero_job_get_tmp_file (BRASERO_JOB (genisoimage),
NULL,
&excluded_path,
error);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
return result;
}
@@ -271,6 +282,7 @@
&emptydir,
error);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -280,10 +292,12 @@
grafts_path,
excluded_path,
emptydir,
+ videodir,
error);
g_free (emptydir);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -324,6 +338,7 @@
brasero_job_get_last_session_address (BRASERO_JOB (genisoimage), &last_session);
brasero_job_get_next_writable_address (BRASERO_JOB (genisoimage), &next_wr_add);
if (last_session == -1 || next_wr_add == -1) {
+ g_free (videodir);
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
@@ -358,6 +373,12 @@
NULL,
FALSE);
brasero_job_start_progress (BRASERO_JOB (genisoimage), FALSE);
+
+ if (videodir) {
+ g_ptr_array_add (argv, g_strdup ("-f"));
+ g_ptr_array_add (argv, videodir);
+ }
+
return BRASERO_BURN_OK;
}
@@ -367,13 +388,20 @@
result = brasero_job_get_image_output (BRASERO_JOB (genisoimage),
&output,
NULL);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
return result;
+ }
g_ptr_array_add (argv, g_strdup ("-o"));
g_ptr_array_add (argv, output);
}
+ if (videodir) {
+ g_ptr_array_add (argv, g_strdup ("-f"));
+ g_ptr_array_add (argv, videodir);
+ }
+
brasero_job_set_current_action (BRASERO_JOB (genisoimage),
BRASERO_BURN_ACTION_CREATING_IMAGE,
NULL,
Modified: trunk/src/plugins/cdrtools/burn-mkisofs.c
==============================================================================
--- trunk/src/plugins/cdrtools/burn-mkisofs.c (original)
+++ trunk/src/plugins/cdrtools/burn-mkisofs.c Sun Jun 8 16:08:07 2008
@@ -209,6 +209,7 @@
BraseroTrack *track;
BraseroTrackType type;
BraseroBurnFlag flags;
+ gchar *videodir = NULL;
gchar *emptydir = NULL;
BraseroJobAction action;
BraseroBurnResult result;
@@ -235,9 +236,16 @@
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)
+ if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
+ result = brasero_job_get_tmp_dir (BRASERO_JOB (mkisofs),
+ &videodir,
+ error);
+ if (result != BRASERO_BURN_OK)
+ return result;
+ }
+
g_ptr_array_add (argv, g_strdup ("-graft-points"));
if (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
@@ -247,8 +255,10 @@
NULL,
&grafts_path,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
return result;
+ }
result = brasero_job_get_tmp_file (BRASERO_JOB (mkisofs),
NULL,
@@ -256,6 +266,7 @@
error);
if (result != BRASERO_BURN_OK) {
g_free (grafts_path);
+ g_free (videodir);
return result;
}
@@ -263,6 +274,7 @@
&emptydir,
error);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -272,10 +284,12 @@
grafts_path,
excluded_path,
emptydir,
+ videodir,
error);
g_free (emptydir);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -316,6 +330,7 @@
brasero_job_get_last_session_address (BRASERO_JOB (mkisofs), &last_session);
brasero_job_get_next_writable_address (BRASERO_JOB (mkisofs), &next_wr_add);
if (last_session == -1 || next_wr_add == -1) {
+ g_free (videodir);
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
@@ -356,6 +371,12 @@
NULL,
FALSE);
brasero_job_start_progress (BRASERO_JOB (mkisofs), FALSE);
+
+ if (videodir) {
+ g_ptr_array_add (argv, g_strdup ("-f"));
+ g_ptr_array_add (argv, videodir);
+ }
+
return BRASERO_BURN_OK;
}
@@ -365,13 +386,20 @@
result = brasero_job_get_image_output (BRASERO_JOB (mkisofs),
&output,
NULL);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
return result;
+ }
g_ptr_array_add (argv, g_strdup ("-o"));
g_ptr_array_add (argv, output);
}
+ if (videodir) {
+ g_ptr_array_add (argv, g_strdup ("-f"));
+ g_ptr_array_add (argv, videodir);
+ }
+
brasero_job_set_current_action (BRASERO_JOB (mkisofs),
BRASERO_BURN_ACTION_CREATING_IMAGE,
NULL,
Modified: trunk/src/plugins/growisofs/burn-growisofs.c
==============================================================================
--- trunk/src/plugins/growisofs/burn-growisofs.c (original)
+++ trunk/src/plugins/growisofs/burn-growisofs.c Sun Jun 8 16:08:07 2008
@@ -231,6 +231,7 @@
BraseroBurnResult result;
BraseroTrackType input;
gchar *emptydir = NULL;
+ gchar *videodir = NULL;
g_ptr_array_add (argv, g_strdup ("-r"));
@@ -251,9 +252,16 @@
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)
+ if (input.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
+ result = brasero_job_get_tmp_dir (BRASERO_JOB (growisofs),
+ &videodir,
+ error);
+ if (result != BRASERO_BURN_OK)
+ return result;
+ }
+
priv = BRASERO_GROWISOFS_PRIVATE (growisofs);
if (priv->use_utf8) {
g_ptr_array_add (argv, g_strdup ("-input-charset"));
@@ -269,8 +277,10 @@
NULL,
&grafts_path,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
return result;
+ }
result = brasero_job_get_tmp_file (BRASERO_JOB (growisofs),
NULL,
@@ -278,6 +288,7 @@
error);
if (result != BRASERO_BURN_OK) {
g_free (grafts_path);
+ g_free (videodir);
return result;
}
@@ -285,6 +296,7 @@
&emptydir,
error);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -294,10 +306,12 @@
grafts_path,
excluded_path,
emptydir,
+ videodir,
error);
g_free (emptydir);
if (result != BRASERO_BURN_OK) {
+ g_free (videodir);
g_free (grafts_path);
g_free (excluded_path);
return result;
@@ -341,6 +355,11 @@
g_ptr_array_add (argv, g_strdup ("-print-size"));
}
+ if (videodir) {
+ g_ptr_array_add (argv, g_strdup ("-f"));
+ g_ptr_array_add (argv, videodir);
+ }
+
return BRASERO_BURN_OK;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]