~ubuntu-branches/ubuntu/lucid/brasero/lucid-updates

« back to all changes in this revision

Viewing changes to libbrasero-burn/brasero-caps-burn.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-06-24 11:22:46 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100624112246-s5ubbf8tafqkir0m
Tags: 2.30.2-0ubuntu1
* New upstream release
  - Lot's of memleak fixes
  - Fixed a runtime warning related to cancelling tracker searches
  - Crash in brasero_data_project_node_removed at
    brasero-data-project.c:1163
  - brasero crashed with SIGSEGV in brasero_data_project_remove_node()
    (LP: #561319)
  - Fix a few runtime warnings with the Cover Editor
  - Text in cover editor does not show up automatically (LP: #469459)
  - Removed use of deprecated flags
  - Use accessor functions instead direct access (use GSEAL GnomeGoal)
  - Fix a bug in the layout on first start (side pane was hidden and
    remained so until the user moved it)
  - Save printer settings for cover printing
  - Write the contents of the GtkTextBuffer displayed line by displayed
    line which should improve the layout
  - "Write to Disc" button sensitivity regression
  - Fix flaw in mask that led libburn plugin not to work (not to be picked
    up actually) in some circumstances
  - Fails to burn ANY audio project
  - Move columns doesn't work (LP: #581759)
  - Brasero does not correctly handle double clicking on column separators
    (LP: #581885)
  - Bad info when burning, high CPU usage and slow burn
  - Change the priority for cdrdao and raised the one of cdda2wav plugin
  - brasero crashed with SIGSEGV in
    brasero_mmc3_get_performa nce_wrt_spd_desc() (LP: #564766)
  - brasero crashed with SIGSEGV in brasero_scsi_command_issue_sync()
    (LP: #444832)
  - Do not check for symlinks on cdda2wav so the plugin can use icedax.
  - Brasero's failure with some file names (LP: #380643)
  - Pressing create audio cd does nothing
  - Empty project not available
  - can't actually save error logs
  - doesn't handle incorrect temp dirs properly
  - Fix multi DND in GtkFileChooser
  - Displays "starting to record" during whole burn process
  - Fix wrong report of speed with both cdrecord and wodim
  - Disk project doesn't save the disk title (LP: #587924)
  - Brasero reports outdated cdrtools on cdrtools-3.00 (LP: #592075)
  - misc bug fixes
  - Updated Translations
* Removed upstream patches:
  - debian/patches/90_git_audio_project_creation.patch,
    debian/patches/91_git_audio_project_creation.patch,
    debian/patches/92_git_audio_cd_recording.patch,
    debian/patches/93_git_new_caps_function_definition.patch
* debian/patches/99_autoconf.patch:
  - refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
 
171
171
typedef struct _BraseroCapsLinkList BraseroCapsLinkList;
172
172
struct _BraseroCapsLinkList {
173
 
        BraseroCapsLinkList *next;
174
173
        BraseroCapsLink *link;
175
174
        BraseroPlugin *plugin;
176
175
};
177
176
 
178
 
static BraseroCapsLinkList *
179
 
brasero_caps_link_list_insert (BraseroCapsLinkList *list,
180
 
                               BraseroCapsLinkList *node,
181
 
                               gboolean fits)
182
 
{
183
 
        BraseroCapsLinkList *iter;
184
 
 
185
 
        if (!list)
186
 
                return node;
187
 
 
188
 
        if (brasero_plugin_get_priority (node->plugin) >
189
 
            brasero_plugin_get_priority (list->plugin)) {
190
 
                node->next = list;
191
 
                return node;
192
 
        }
193
 
 
194
 
        if (brasero_plugin_get_priority (node->plugin) ==
195
 
            brasero_plugin_get_priority (list->plugin)) {
196
 
                if (fits) {
197
 
                        node->next = list;
198
 
                        return node;
199
 
                }
200
 
 
201
 
                node->next = list->next;
202
 
                list->next = node;
203
 
                return list;
204
 
        }
205
 
 
206
 
        if (!list->next) {
207
 
                node->next = NULL;
208
 
                list->next = node;
209
 
                return list;
210
 
        }
211
 
 
212
 
        /* Need a node with at least the same priority. Stop if end is reached */
213
 
        iter = list;
214
 
        while (iter->next &&
215
 
               brasero_plugin_get_priority (node->plugin) <
216
 
               brasero_plugin_get_priority (iter->next->plugin))
217
 
                iter = iter->next;
218
 
 
219
 
        if (!iter->next) {
220
 
                /* reached the end of the list, put it at the end */
221
 
                iter->next = node;
222
 
                node->next = NULL;
223
 
        }
224
 
        else if (brasero_plugin_get_priority (node->plugin) <
225
 
                 brasero_plugin_get_priority (iter->next->plugin)) {
226
 
                /* Put it at the end of the list */
227
 
                node->next = NULL;
228
 
                iter->next->next = node;
229
 
        }
230
 
        else if (brasero_plugin_get_priority (node->plugin) >
231
 
                 brasero_plugin_get_priority (iter->next->plugin)) {
232
 
                /* insert it before iter->next */
233
 
                node->next = iter->next;
234
 
                iter->next = node;
235
 
        }
236
 
        else if (fits) {
237
 
                /* insert it before the link with the same priority */
238
 
                node->next = iter->next;
239
 
                iter->next = node;
240
 
        }
241
 
        else {
242
 
                /* insert it after the link with the same priority */
243
 
                node->next = iter->next->next;
244
 
                iter->next->next = node;
245
 
        }
246
 
        return list;
 
177
static gint
 
178
brasero_caps_link_list_sort (gconstpointer a,
 
179
                             gconstpointer b)
 
180
{
 
181
        const BraseroCapsLinkList *node1 = a;
 
182
        const BraseroCapsLinkList *node2 = b;
 
183
        return brasero_plugin_get_priority (node2->plugin) -
 
184
               brasero_plugin_get_priority (node1->plugin);
 
185
}
 
186
 
 
187
static GSList *
 
188
brasero_caps_get_best_path (GSList *path1,
 
189
                            GSList *path2)
 
190
{
 
191
        GSList *iter1, *iter2;
 
192
 
 
193
        iter1 = path1;
 
194
        iter2 = path2;
 
195
 
 
196
        for (; iter1 && iter2; iter1 = iter1->next, iter2 = iter2->next) {
 
197
                gint priority1, priority2;
 
198
                BraseroCapsLinkList *node1, *node2;
 
199
 
 
200
                node1 = iter1->data;
 
201
                node2 = iter2->data;
 
202
                priority1 = brasero_plugin_get_priority (node1->plugin);
 
203
                priority2 = brasero_plugin_get_priority (node2->plugin);
 
204
                if (priority1 > priority2) {
 
205
                        g_slist_foreach (path2, (GFunc) g_free, NULL);
 
206
                        g_slist_free (path2);
 
207
                        return path1;
 
208
                }
 
209
 
 
210
                if (priority1 < priority2) {
 
211
                        g_slist_foreach (path1, (GFunc) g_free, NULL);
 
212
                        g_slist_free (path1);
 
213
                        return path2;
 
214
                }
 
215
        }
 
216
 
 
217
        /* equality all along or one of them is shorter. Keep the shorter or
 
218
         * path1 in case of complete equality. */
 
219
        if (!iter2 && iter1) {
 
220
                /* This one seems shorter */
 
221
                g_slist_foreach (path1, (GFunc) g_free, NULL);
 
222
                g_slist_free (path1);
 
223
                return path2;
 
224
        }
 
225
 
 
226
        g_slist_foreach (path2, (GFunc) g_free, NULL);
 
227
        g_slist_free (path2);
 
228
        return path1;
 
229
}
 
230
 
 
231
static GSList *
 
232
brasero_caps_find_best_link (BraseroCaps *caps,
 
233
                             gint group_id,
 
234
                             GSList *used_caps,
 
235
                             BraseroBurnFlag session_flags,
 
236
                             BraseroMedia media,
 
237
                             BraseroTrackType *input,
 
238
                             BraseroPluginIOFlag io_flags);
 
239
 
 
240
static GSList *
 
241
brasero_caps_get_plugin_results (BraseroCapsLinkList *node,
 
242
                                 int group_id,
 
243
                                 GSList *used_caps,
 
244
                                 BraseroBurnFlag session_flags,
 
245
                                 BraseroMedia media,
 
246
                                 BraseroTrackType *input,
 
247
                                 BraseroPluginIOFlag io_flags)
 
248
{
 
249
        GSList *results;
 
250
        guint search_group_id;
 
251
        GSList *plugin_used_caps = g_slist_copy (used_caps);
 
252
 
 
253
        /* determine the group_id for the search */
 
254
        if (brasero_plugin_get_group (node->plugin) > 0 && group_id <= 0)
 
255
                search_group_id = brasero_plugin_get_group (node->plugin);
 
256
        else
 
257
                search_group_id = group_id;
 
258
 
 
259
        /* It's not a perfect fit. First see if a plugin with the same
 
260
         * priority don't have the right input. Then see if we can reach
 
261
         * the right input by going through all previous nodes */
 
262
        results = brasero_caps_find_best_link (node->link->caps,
 
263
                                               search_group_id,
 
264
                                               plugin_used_caps,
 
265
                                               session_flags,
 
266
                                               media,
 
267
                                               input,
 
268
                                               io_flags);
 
269
        g_slist_free (plugin_used_caps);
 
270
        return results;
 
271
}
 
272
 
 
273
static gboolean
 
274
brasero_caps_link_list_have_processing_plugin (GSList *list)
 
275
{
 
276
        GSList *iter;
 
277
        BraseroPluginProcessFlag position;
 
278
 
 
279
        position = BRASERO_PLUGIN_RUN_BEFORE_TARGET;
 
280
 
 
281
        for (iter = list; iter; iter = iter->next) {
 
282
                BraseroCapsLinkList *node;
 
283
                BraseroCaps *caps;
 
284
                GSList *modifiers;
 
285
 
 
286
                node = list->data;
 
287
                caps = node->link->caps;
 
288
 
 
289
                if (brasero_track_type_get_has_medium (&caps->type))
 
290
                        continue;
 
291
 
 
292
                if (!iter->next)
 
293
                        position = BRASERO_PLUGIN_RUN_PREPROCESSING;
 
294
 
 
295
                for (modifiers = caps->modifiers; modifiers; modifiers = modifiers->next) {
 
296
                        BraseroPluginProcessFlag flags;
 
297
                        BraseroPlugin *plugin;
 
298
 
 
299
                        plugin = modifiers->data;
 
300
                        if (!brasero_plugin_get_active (plugin, 0))
 
301
                                continue;
 
302
 
 
303
                        brasero_plugin_get_process_flags (plugin, &flags);
 
304
                        if ((flags & position) == position)
 
305
                                return TRUE;
 
306
                }
 
307
        }
 
308
 
 
309
        return FALSE;
247
310
}
248
311
 
249
312
static GSList *
256
319
                             BraseroPluginIOFlag io_flags)
257
320
{
258
321
        GSList *iter;
 
322
        GSList *list = NULL;
259
323
        GSList *results = NULL;
 
324
        gboolean perfect_fit = FALSE;
260
325
        BraseroCapsLinkList *node = NULL;
261
 
        BraseroCapsLinkList *list = NULL;
 
326
        gboolean have_processing_plugin = FALSE;
262
327
 
263
328
        BRASERO_BURN_LOG_WITH_TYPE (&caps->type, BRASERO_PLUGIN_IO_NONE, "find_best_link");
264
329
 
298
363
                        continue;
299
364
                }
300
365
 
 
366
                if (brasero_track_type_get_has_medium (&caps->type)) {
 
367
                        if (brasero_caps_link_check_recorder_flags_for_input (link, session_flags))
 
368
                                continue;               
 
369
                }
 
370
 
301
371
                /* see if that's a perfect fit;
302
372
                 * - it must have the same caps (type + subtype)
303
373
                 * - it must have the proper IO (file). */
335
405
                        continue;
336
406
                }
337
407
 
338
 
                BRASERO_BURN_LOG ("Found candidate link");
 
408
                BRASERO_BURN_LOG_TYPE (&link->caps->type, "Found candidate link");
339
409
 
340
410
                /* A plugin could be found which means that link can be used.
341
411
                 * Insert it in the list at the right place.
346
416
                node->plugin = plugin;
347
417
                node->link = link;
348
418
 
349
 
                list = brasero_caps_link_list_insert (list, node, fits);
 
419
                list = g_slist_insert_sorted (list, node, brasero_caps_link_list_sort);
350
420
        }
351
421
 
352
422
        if (!list) {
358
428
 
359
429
        /* Then, go through this list (starting with highest priority links)
360
430
         * The rule is we prefer the links with the highest priority; if two
361
 
         * links have the same priority and one of them leads to a caps
362
 
         * with the correct type then choose this one. */
363
 
        for (node = list; node; node = node->next) {
364
 
                guint search_group_id;
 
431
         * links have the same priority and one of them leads to a caps with
 
432
         * the correct type then choose this one. */
 
433
        for (iter = list; iter; iter = iter->next) {
 
434
                BraseroCapsLinkList *iter_node;
 
435
 
 
436
                iter_node = iter->data;
 
437
 
 
438
                BRASERO_BURN_LOG ("Trying %s with a priority of %i",
 
439
                                  brasero_plugin_get_name (iter_node->plugin),
 
440
                                  brasero_plugin_get_priority (iter_node->plugin));
365
441
 
366
442
                /* see if that's a perfect fit; if so, then we're good. 
367
443
                 * - it must have the same caps (type + subtype)
368
 
                 * - it must have the proper IO (file) */
369
 
                if ((node->link->caps->flags & BRASERO_PLUGIN_IO_ACCEPT_FILE)
370
 
                &&   brasero_caps_is_compatible_type (node->link->caps, input)) {
371
 
                        results = g_slist_prepend (NULL, node->link);
 
444
                 * - it must have the proper IO (file).
 
445
                 * The only case where we don't want a perfect fit is when the
 
446
                 * other possibility allows for the inclusion and expression
 
447
                 * of active track processing plugins. It allows for example to
 
448
                 * choose:
 
449
                 * mkisofs => checksum image => growisofs
 
450
                 * instead of simply:
 
451
                 * growisofs.  */
 
452
                if ((iter_node->link->caps->flags & BRASERO_PLUGIN_IO_ACCEPT_FILE)
 
453
                &&   brasero_caps_is_compatible_type (iter_node->link->caps, input)) {
 
454
                        perfect_fit = TRUE;
372
455
                        break;
373
456
                }
374
457
 
375
 
                /* determine the group_id for the search */
376
 
                if (brasero_plugin_get_group (node->plugin) > 0 && group_id <= 0)
377
 
                        search_group_id = brasero_plugin_get_group (node->plugin);
378
 
                else
379
 
                        search_group_id = group_id;
380
 
 
381
 
                /* It's not a perfect fit. First see if a plugin with the same
382
 
                 * priority don't have the right input. Then see if we can reach
383
 
                 * the right input by going through all previous nodes */
384
 
                results = brasero_caps_find_best_link (node->link->caps,
385
 
                                                       search_group_id,
386
 
                                                       used_caps,
387
 
                                                       session_flags,
388
 
                                                       media,
389
 
                                                       input,
390
 
                                                       io_flags);
 
458
                results = brasero_caps_get_plugin_results (iter_node,
 
459
                                                           group_id,
 
460
                                                           used_caps,
 
461
                                                           session_flags,
 
462
                                                           media,
 
463
                                                           input,
 
464
                                                           io_flags);
391
465
                if (results) {
392
 
                        results = g_slist_prepend (results, node->link);
393
 
                        break;
394
 
                }
395
 
        }
 
466
                        have_processing_plugin = brasero_caps_link_list_have_processing_plugin (results);
 
467
                        break;
 
468
                }
 
469
        }
 
470
 
 
471
        /* Do not check for results that could be NULL in case of a perfect fit */
 
472
        if (!iter)
 
473
                goto end;
 
474
 
 
475
        node = iter->data;
 
476
 
 
477
        /* Stage 3: there may be other link with the same priority (most the
 
478
         * time because it is the same plugin) so we try them as well and keep
 
479
         * the one whose next plugin in the list has the highest priority. */
 
480
        for (iter = iter->next; iter; iter = iter->next) {
 
481
                GSList *other_results;
 
482
                BraseroCapsLinkList *iter_node;
 
483
 
 
484
                iter_node = iter->data;
 
485
                if (brasero_plugin_get_priority (iter_node->plugin) !=
 
486
                    brasero_plugin_get_priority (node->plugin))
 
487
                        break;
 
488
 
 
489
                BRASERO_BURN_LOG ("Trying %s with a priority of %i",
 
490
                                  brasero_plugin_get_name (iter_node->plugin),
 
491
                                  brasero_plugin_get_priority (iter_node->plugin));
 
492
 
 
493
                /* see if that's a perfect fit */
 
494
                if ((iter_node->link->caps->flags & BRASERO_PLUGIN_IO_ACCEPT_FILE) == 0
 
495
                ||  !brasero_caps_is_compatible_type (iter_node->link->caps, input)) {
 
496
                        other_results = brasero_caps_get_plugin_results (iter_node,
 
497
                                                                         group_id,
 
498
                                                                         used_caps,
 
499
                                                                         session_flags,
 
500
                                                                         media,
 
501
                                                                         input,
 
502
                                                                         io_flags);
 
503
                        if (!other_results)
 
504
                                continue;
 
505
 
 
506
                        if (perfect_fit) {
 
507
                                have_processing_plugin = brasero_caps_link_list_have_processing_plugin (other_results);
 
508
                                if (have_processing_plugin) {
 
509
                                        /* Note: results == NULL for perfect fit */
 
510
                                        results = other_results;
 
511
 
 
512
                                        perfect_fit = FALSE;
 
513
                                        node = iter_node;
 
514
                                }
 
515
                                else {
 
516
                                        g_slist_foreach (other_results, (GFunc) g_free, NULL);
 
517
                                        g_slist_free (other_results);
 
518
                                }
 
519
                        }
 
520
                        else {
 
521
                                results = brasero_caps_get_best_path (results, other_results);
 
522
                                if (results == other_results) {
 
523
                                        have_processing_plugin = brasero_caps_link_list_have_processing_plugin (other_results);
 
524
                                        node = iter_node;
 
525
                                }
 
526
                        }
 
527
                }
 
528
                else if (!perfect_fit && !have_processing_plugin) {
 
529
                        g_slist_foreach (results, (GFunc) g_free, NULL);
 
530
                        g_slist_free (results);
 
531
                        results = NULL;
 
532
 
 
533
                        perfect_fit = TRUE;
 
534
                        node = iter_node;
 
535
                }
 
536
        }
 
537
 
 
538
        results = g_slist_prepend (results, node);
 
539
        list = g_slist_remove (list, node);
 
540
 
 
541
end:
396
542
 
397
543
        /* clear up */
398
544
        used_caps = g_slist_remove (used_caps, caps);
399
 
        for (node = list; node; node = list) {
400
 
                list = node->next;
401
 
                g_free (node);
402
 
        }
 
545
        g_slist_foreach (list, (GFunc) g_free, NULL);
 
546
        g_slist_free (list);
403
547
 
404
548
        return results;
405
549
}
426
570
        GSList *modifiers;
427
571
        GSList *iter;
428
572
 
429
 
        if (position == BRASERO_PLUGIN_RUN_NEVER
430
 
        ||  caps->type.type == BRASERO_TRACK_TYPE_DISC)
 
573
        if (brasero_track_type_get_has_medium (&caps->type))
431
574
                return NULL;
432
575
 
433
576
        BRASERO_BURN_LOG_WITH_TYPE (&caps->type,
506
649
        GSList *retval = NULL;
507
650
        GSList *iter, *list;
508
651
        BraseroMedia media;
509
 
        gint group_id;
510
652
        gboolean res;
511
653
 
512
654
        /* determine the output and the flags for this task */
564
706
                 * handle this flag (means that the plugin should erase and
565
707
                 * then write on its own. Basically that works only with
566
708
                 * overwrite formatted discs, DVD+RW, ...) */
567
 
                if (output.type != BRASERO_TRACK_TYPE_DISC)
 
709
                if (!brasero_track_type_get_has_medium (&output))
568
710
                        BRASERO_BURN_CAPS_NOT_SUPPORTED_LOG_ERROR (session, error);
569
711
 
570
712
                /* output is a disc try with initial blanking */
585
727
                           BRASERO_MEDIUM_HAS_AUDIO);
586
728
                media |= BRASERO_MEDIUM_BLANK;
587
729
 
588
 
                output.subtype.media = media;
 
730
                brasero_track_type_set_medium_type (&output, media);
589
731
 
590
732
                last_caps = brasero_burn_caps_find_start_caps (self, &output);
591
733
                if (!last_caps)
621
763
        /* reverse the list of links to have them in the right order */
622
764
        list = g_slist_reverse (list);
623
765
        position = BRASERO_PLUGIN_RUN_PREPROCESSING;
624
 
        group_id = self->priv->group_id;
625
766
 
626
767
        brasero_burn_session_get_input_type (session, &plugin_input);
627
768
        for (iter = list; iter; iter = iter->next) {
628
769
                BraseroTrackType plugin_output;
629
 
                BraseroCapsLink *link;
630
 
                BraseroPlugin *plugin;
 
770
                BraseroCapsLinkList *node;
631
771
                BraseroJob *job;
632
772
                GSList *result;
633
773
                GType type;
634
774
 
635
 
                link = iter->data;
 
775
                node = iter->data;
636
776
 
637
777
                /* determine the plugin output:
638
 
                 * if it's not the last one it takes the input
639
 
                 * of the next plugin as its output.
 
778
                 * if it's not the last one it takes the input of the next
 
779
                 * plugin as its output.
640
780
                 * Otherwise it uses the final output type */
641
 
                if (iter->next)
 
781
                if (iter->next) {
 
782
                        BraseroCapsLinkList *next_node;
 
783
 
 
784
                        next_node = iter->next->data;
642
785
                        memcpy (&plugin_output,
643
 
                                &((BraseroCapsLink *) (iter->next->data))->caps->type,
 
786
                                &next_node->link->caps->type,
644
787
                                sizeof (BraseroTrackType));
 
788
                }
645
789
                else
646
790
                        memcpy (&plugin_output,
647
791
                                &output,
650
794
                /* first see if there are track processing plugins */
651
795
                result = brasero_caps_add_processing_plugins_to_task (session,
652
796
                                                                      task,
653
 
                                                                      link->caps,
 
797
                                                                      node->link->caps,
654
798
                                                                      &plugin_input,
655
799
                                                                      position);
656
800
                retval = g_slist_concat (retval, result);
657
801
 
658
 
                /* create job from the best plugin in link */
659
 
                plugin = brasero_caps_link_find_plugin (link,
660
 
                                                        group_id,
661
 
                                                        session_flags,
662
 
                                                        &plugin_output,
663
 
                                                        media);
664
 
                if (!plugin) {
665
 
                        g_set_error (error,
666
 
                                     BRASERO_BURN_ERROR,
667
 
                                     BRASERO_BURN_ERROR_GENERAL,
668
 
                                     _("An internal error occurred"));
669
 
                        g_slist_foreach (retval, (GFunc) g_object_unref, NULL);
670
 
                        g_slist_free (retval);
671
 
                        g_slist_free (list);
672
 
                        return NULL;
673
 
                }
674
 
 
675
 
                /* This is meant to have plugins in the same group id as much as
676
 
                 * possible */
677
 
                if (brasero_plugin_get_group (plugin) > 0 && group_id <= 0)
678
 
                        group_id = brasero_plugin_get_group (plugin);
679
 
 
680
 
                type = brasero_plugin_get_gtype (plugin);
 
802
                /* Create an object from the plugin */
 
803
                type = brasero_plugin_get_gtype (node->plugin);
681
804
                job = BRASERO_JOB (g_object_new (type,
682
805
                                                 "output", &plugin_output,
683
806
                                                 NULL));
684
807
                g_signal_connect (job,
685
808
                                  "error",
686
809
                                  G_CALLBACK (brasero_burn_caps_job_error_cb),
687
 
                                  link);
 
810
                                  node->link);
688
811
 
689
812
                if (!task
690
 
                ||  !(link->caps->flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE)
 
813
                ||  !(node->link->caps->flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE)
691
814
                ||  !BRASERO_BURN_SESSION_NO_TMP_FILE (session)) {
692
815
                        /* only the last task will be doing the proper action
693
816
                         * all other are only steps to take to reach the final
702
825
 
703
826
                brasero_task_add_item (task, BRASERO_TASK_ITEM (job));
704
827
 
705
 
                BRASERO_BURN_LOG ("%s added to task", brasero_plugin_get_name (plugin));
 
828
                BRASERO_BURN_LOG ("%s added to task", brasero_plugin_get_name (node->plugin));
706
829
                BRASERO_BURN_LOG_TYPE (&plugin_input, "input");
707
830
                BRASERO_BURN_LOG_TYPE (&plugin_output, "output");
708
831
 
711
834
                /* the output of the plugin will become the input of the next */
712
835
                memcpy (&plugin_input, &plugin_output, sizeof (BraseroTrackType));
713
836
        }
 
837
        g_slist_foreach (list, (GFunc) g_free, NULL);
714
838
        g_slist_free (list);
715
839
 
716
840
        /* add the post processing plugins */
721
845
                                                            BRASERO_PLUGIN_RUN_AFTER_TARGET);
722
846
        retval = g_slist_concat (retval, list);
723
847
 
724
 
        if (last_caps->type.type == BRASERO_TRACK_TYPE_DISC && blanking) {
 
848
        if (brasero_track_type_get_has_medium (&last_caps->type) && blanking) {
725
849
                retval = g_slist_insert_before (retval,
726
850
                                                g_slist_last (retval),
727
851
                                                blanking);
867
991
        list = g_slist_reverse (list);
868
992
        for (iter = list; iter; iter = iter->next) {
869
993
                GType type;
870
 
                GSList *plugins;
871
 
                BraseroCapsLink *link;
872
 
                BraseroPlugin *candidate_plugin;
 
994
                BraseroCapsLinkList *node;
873
995
                BraseroTrackType *plugin_output;
874
996
 
875
 
                link = iter->data;
 
997
                node = iter->data;
876
998
 
877
999
                /* determine the plugin output */
878
1000
                if (iter->next) {
884
1006
                else
885
1007
                        plugin_output = &last_caps->type;
886
1008
 
887
 
                /* find the best plugin */
888
 
                candidate_plugin = NULL;
889
 
                for (plugins = link->plugins; plugins; plugins = plugins->next) {
890
 
                        BraseroPlugin *plugin;
891
 
 
892
 
                        plugin = plugins->data;
893
 
 
894
 
                        if (!brasero_plugin_get_active (plugin, 0))
895
 
                                continue;
896
 
 
897
 
                        if (!candidate_plugin)
898
 
                                candidate_plugin = plugin;
899
 
                        else if (brasero_plugin_get_priority (plugin) >
900
 
                                 brasero_plugin_get_priority (candidate_plugin))
901
 
                                candidate_plugin = plugin;
902
 
                }
903
 
 
904
1009
                /* create the object */
905
 
                type = brasero_plugin_get_gtype (candidate_plugin);
 
1010
                type = brasero_plugin_get_gtype (node->plugin);
906
1011
                job = BRASERO_JOB (g_object_new (type,
907
1012
                                                 "output", plugin_output,
908
1013
                                                 NULL));
909
1014
                g_signal_connect (job,
910
1015
                                  "error",
911
1016
                                  G_CALLBACK (brasero_burn_caps_job_error_cb),
912
 
                                  link);
 
1017
                                  node->link);
913
1018
 
914
1019
                brasero_task_add_item (task, BRASERO_TASK_ITEM (job));
915
1020
 
916
 
                BRASERO_BURN_LOG ("%s added to task", brasero_plugin_get_name (candidate_plugin));
 
1021
                BRASERO_BURN_LOG ("%s added to task", brasero_plugin_get_name (node->plugin));
917
1022
        }
 
1023
        g_slist_foreach (list, (GFunc) g_free, NULL);
918
1024
        g_slist_free (list);
919
1025
 
920
1026
        /* Create the candidate */