133
133
gchar *character;
134
134
gchar *localpath;
135
gchar *unescaped_uri;
136
135
BraseroBurnResult result = BRASERO_BURN_OK;
138
137
/* make sure uri is local: otherwise error out */
139
138
/* FIXME: uri can be path or URI? problem with graft->uri */
140
139
if (uri && uri [0] == '/') {
141
localpath = g_strdup (unescaped_uri);
140
localpath = g_strdup (uri);
143
142
else if (uri && g_str_has_prefix (uri, "file://")) {
144
143
gchar *unescaped_uri;
497
496
static BraseroBurnResult
497
brasero_mkisofs_base_create_video_empty (BraseroMkisofsBase *base,
498
const gchar *disc_path)
502
BRASERO_BURN_LOG ("Creating an empty Video or Audio directory");
504
if (base->found_video_ts)
505
return BRASERO_BURN_OK;
507
base->found_video_ts = TRUE;
509
path = g_build_path (G_DIR_SEPARATOR_S,
514
g_mkdir_with_parents (path, S_IRWXU);
517
return BRASERO_BURN_OK;
520
static BraseroBurnResult
498
521
brasero_mkisofs_base_empty_directory (BraseroMkisofsBase *base,
499
522
const gchar *disc_path,
504
527
gchar *graft_point;
505
528
const gchar *path;
530
/* This is a special case when the URI is NULL which can happen mainly
531
* when we have to deal with burn:// uri. */
532
if (base->videodir) {
533
/* try with "VIDEO_TS", "VIDEO_TS/", "VIDEO_TS/" and "/VIDEO_TS/"
534
* to make sure we don't miss one */
535
if (!strcmp (disc_path, "VIDEO_TS")
536
|| !strcmp (disc_path, "/VIDEO_TS")
537
|| !strcmp (disc_path, "VIDEO_TS/")
538
|| !strcmp (disc_path, "/VIDEO_TS/")) {
539
brasero_mkisofs_base_create_video_empty (base, disc_path);
541
/* NOTE: joliet cannot be used in this case so that's
542
* perfectly fine to forget about it. */
543
return BRASERO_BURN_OK;
507
547
/* Mangle the name in case joliet is required */
508
548
if (base->use_joliet) {
509
549
base->joliet = brasero_mkisofs_base_mangle_joliet_name (base->joliet,
534
path = g_filename_from_uri (graft->uri, NULL, NULL);
574
/* Make sure it's a path and not a URI */
575
if (!strncmp (graft->uri, "file:", 5))
576
path = g_filename_from_uri (graft->uri, NULL, NULL);
578
path = g_strdup (graft->uri);
535
580
if (g_str_has_suffix (path, G_DIR_SEPARATOR_S)) {
601
646
* passed by the calling plugins. */
602
647
if (base->videodir) {
603
648
BraseroBurnResult res;
605
651
/* try with "VIDEO_TS", "VIDEO_TS/", "VIDEO_TS/" and "/VIDEO_TS/"
606
652
* to make sure we don't miss one */
607
if (!strcmp (graft->path , "VIDEO_TS")
608
|| !strcmp (graft->path , "/VIDEO_TS")
609
|| !strcmp (graft->path , "VIDEO_TS/")
610
|| !strcmp (graft->path , "/VIDEO_TS/")) {
653
if (!strcmp (graft->path, "VIDEO_TS")
654
|| !strcmp (graft->path, "/VIDEO_TS")
655
|| !strcmp (graft->path, "VIDEO_TS/")
656
|| !strcmp (graft->path, "/VIDEO_TS/")) {
611
657
res = brasero_mkisofs_base_process_video_graft (base, graft, error);
612
658
if (res != BRASERO_BURN_OK)
615
661
base->found_video_ts = TRUE;
616
662
return BRASERO_BURN_OK;
618
else if (!strcmp (graft->path , "AUDIO_TS")
619
|| !strcmp (graft->path , "/AUDIO_TS")
620
|| !strcmp (graft->path , "AUDIO_TS/")
621
|| !strcmp (graft->path , "/AUDIO_TS/"))
622
return brasero_mkisofs_base_process_video_graft (base, graft, error);
665
if (!strcmp (graft->path, "AUDIO_TS")
666
|| !strcmp (graft->path, "/AUDIO_TS")
667
|| !strcmp (graft->path, "AUDIO_TS/")
668
|| !strcmp (graft->path, "/AUDIO_TS/"))
669
return brasero_mkisofs_base_process_video_graft (base, graft, error);
671
/* it could also be a direct child of the VIDEO_TS directory */
672
parent = g_path_get_dirname (graft->path);
673
if (!strcmp (parent, "VIDEO_TS")
674
|| !strcmp (parent, "/VIDEO_TS")
675
|| !strcmp (parent, "VIDEO_TS/")
676
|| !strcmp (parent, "/VIDEO_TS/")) {
677
if (!base->found_video_ts)
678
brasero_mkisofs_base_create_video_empty (base, parent);
681
return brasero_mkisofs_base_process_video_graft (base, graft, error);
625
686
/* add the graft point */