~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to plugins/checksum/burn-checksum-image.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-09-08 09:33:41 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090908093341-jh02q5ba0q8jyu9l
Tags: 2.27.92-0ubuntu1
* New upstream release (LP: #425998)
  - Some improvements when handling DVD-RW sequential
  - #593829 - Brasero gets stuck in a loop at "Getting size" while burning another session on a multi-session disk
  - #578466 - Unable to overburn
  - #593314 - Brasero is failing to burn from sftp
  - #593492 - Compilation must be ordered by file name
  - #587122 - Copying DVD - "Error while reading video DVD (no error)"
  - #592026 - brasero crashes when eject a medium
  - #592025 - brasero crashes on detecting src images on a NFS path when preparing burning an image
  - #591880 - Image checksumming causes internal error (LP: #354995)
  - #591397 - Brasero Main window pops up after exiting from Image Burning window.
  - Translation updates
  - lots of small fixes and improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include "brasero-drive.h"
57
57
#include "brasero-track-disc.h"
58
58
#include "brasero-track-image.h"
 
59
#include "brasero-tags.h"
59
60
 
60
61
BRASERO_PLUGIN_BOILERPLATE (BraseroChecksumImage, brasero_checksum_image, BRASERO_TYPE_JOB, BraseroJob);
61
62
 
282
283
        }
283
284
 
284
285
        BRASERO_JOB_LOG (self,
285
 
                         "Starting checksuming file %s (size = %i)",
 
286
                         "Starting checksuming file %s (size = %"G_GOFFSET_FORMAT")",
286
287
                         path,
287
288
                         priv->total);
288
289
 
354
355
        brasero_job_start_progress (BRASERO_JOB (self), FALSE);
355
356
        brasero_job_get_current_track (BRASERO_JOB (self), &track);
356
357
 
357
 
        /* see if another plugin is sending us data to checksum */
 
358
        /* see if another plugin is sending us data to checksum
 
359
         * or if we do it ourself (and then that must be from an
 
360
         * image file only). */
358
361
        if (brasero_job_get_fd_in (BRASERO_JOB (self), NULL) == BRASERO_BURN_OK) {
359
362
                BraseroMedium *medium;
 
363
                GValue *value = NULL;
360
364
                BraseroDrive *drive;
 
365
                guint64 start, end;
 
366
                goffset sectors;
 
367
                goffset bytes;
 
368
 
 
369
                brasero_track_tag_lookup (track,
 
370
                                          BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
 
371
                                          &value);
 
372
 
 
373
                /* we were given an address to start */
 
374
                start = g_value_get_uint64 (value);
 
375
 
 
376
                /* get the length now */
 
377
                value = NULL;
 
378
                brasero_track_tag_lookup (track,
 
379
                                          BRASERO_TRACK_MEDIUM_ADDRESS_END_TAG,
 
380
                                          &value);
 
381
 
 
382
                end = g_value_get_uint64 (value);
 
383
 
 
384
                priv->total = end - start;
361
385
 
362
386
                /* we're only able to checksum ISO format at the moment so that
363
387
                 * means we can only handle last session */
364
388
                drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
365
389
                medium = brasero_drive_get_medium (drive);
366
390
                brasero_medium_get_last_data_track_space (medium,
367
 
                                                          &priv->total,
368
 
                                                          NULL);
 
391
                                                          &bytes,
 
392
                                                          &sectors);
 
393
 
 
394
                /* That's the only way to get the sector size */
 
395
                priv->total *= bytes / sectors;
369
396
 
370
397
                return brasero_checksum_image_checksum_fd_input (self, checksum_type, error);
371
398
        }
392
419
        checksum_type = gconf_client_get_int (client, GCONF_KEY_CHECKSUM_TYPE, NULL);
393
420
        g_object_unref (client);
394
421
 
395
 
        if (!checksum_type)
396
 
                checksum_type = BRASERO_CHECKSUM_MD5;
397
 
 
398
422
        return checksum_type;
399
423
}
400
424
 
409
433
        priv = BRASERO_CHECKSUM_IMAGE_PRIVATE (self);
410
434
 
411
435
        priv->checksum_type = brasero_checksum_get_checksum_type ();
412
 
        if (priv->checksum_type == BRASERO_CHECKSUM_NONE)
413
 
                checksum_type = G_CHECKSUM_MD5;
414
 
        else if (priv->checksum_type & BRASERO_CHECKSUM_MD5)
 
436
 
 
437
        if (priv->checksum_type & BRASERO_CHECKSUM_MD5)
415
438
                checksum_type = G_CHECKSUM_MD5;
416
439
        else if (priv->checksum_type & BRASERO_CHECKSUM_SHA1)
417
440
                checksum_type = G_CHECKSUM_SHA1;
418
441
        else if (priv->checksum_type & BRASERO_CHECKSUM_SHA256)
419
442
                checksum_type = G_CHECKSUM_SHA256;
420
 
        else
 
443
        else {
421
444
                checksum_type = G_CHECKSUM_MD5;
 
445
                priv->checksum_type = BRASERO_CHECKSUM_MD5;
 
446
        }
422
447
 
423
448
        brasero_job_set_current_action (BRASERO_JOB (self),
424
449
                                        BRASERO_BURN_ACTION_CHECKSUM,