~ubuntu-branches/ubuntu/maverick/brasero/maverick

« back to all changes in this revision

Viewing changes to plugins/dvdcss/burn-dvdcss.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-14 10:23:22 UTC
  • mfrom: (1.1.44 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914102322-7eigq8pge5wqfol1
Tags: 2.31.92-0ubuntu1
* New upstream release:
  - Revert to libunique from GApplication (Luis Medinas)
  - Remove dbus-glib requires from pkgconfig file (Luis Medinas)
  - Some more debugging to find out about problems with encrypted DVDs
    (Philippe Rouquier)
  - Fix minor issues in gdbus conversion. (Luis Medinas)
  - Remove dbus-glib check from configure (Luis Medinas)
  - Replace last part of dbus-glib by GDBus (Luis Medinas)
  - Fix Inhibit() d-bus parameters (Robert Ancell)
  - Remove dbus libraries from the Makefile. (Luis Medinas)
  - Use --with-gtk switch for gtk 2/3 selection (Christian Persch)
  - Fix image checksuming that did not occur when GConf or GSetting returned 0
    as a value for the checksum type key (Philippe Rouquier)
  - Don't hardcode gconf gsettings backend (Robert Ancell)
  - Fix brasero plugin directory (Robert Ancell)
* debian/control:
  - build-dep on libunique
* debian/patches/010_lpi.patch,31_link_libice.patch:
  - adapt to latest code
* debian/patches/013_gsettings_backend.patch,014_plugin_directory.patch,
  015_inhibit_params.patch:
  - removed, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
typedef struct _BraseroScrambledSectorRange BraseroScrambledSectorRange;
240
240
 
241
241
static gboolean
242
 
brasero_dvdcss_create_scrambled_sectors_map (GQueue *map,
 
242
brasero_dvdcss_create_scrambled_sectors_map (BraseroDvdcss *self,
 
243
                                             GQueue *map,
243
244
                                             dvdcss_handle *handle,
244
245
                                             BraseroVolFile *parent,
245
246
                                             GError **error)
254
255
                if (!file->isdir) {
255
256
                        if (!strncmp (file->name + strlen (file->name) - 6, ".VOB", 4)) {
256
257
                                BraseroScrambledSectorRange *range;
 
258
                                gsize current_extent;
257
259
                                GSList *extents;
258
260
 
 
261
                                BRASERO_JOB_LOG (self, "Retrieving keys for %s", file->name);
 
262
 
259
263
                                /* take the first address for each extent of the file */
260
 
                                if (!file->specific.file.extents)
 
264
                                if (!file->specific.file.extents) {
 
265
                                        BRASERO_JOB_LOG (self, "Problem: file has no extents");
261
266
                                        return FALSE;
 
267
                                }
262
268
 
263
269
                                range = g_new0 (BraseroScrambledSectorRange, 1);
264
 
                                
265
270
                                for (extents = file->specific.file.extents; extents; extents = extents->next) {
266
271
                                        BraseroVolFileExtent *extent;
267
272
 
268
273
                                        extent = extents->data;
 
274
 
269
275
                                        range->start = extent->block;
270
276
                                        range->end = extent->block + BRASERO_BYTES_TO_SECTORS (extent->size, DVDCSS_BLOCK_SIZE);
271
277
 
 
278
                                        BRASERO_JOB_LOG (self, "From 0x%llx to 0x%llx", range->start, range->end);
272
279
                                        g_queue_push_head (map, range);
273
280
 
274
 
                                        if (dvdcss_seek (handle, range->start, DVDCSS_SEEK_KEY) != range->start) {
 
281
                                        if (extent->size == 0) {
 
282
                                                BRASERO_JOB_LOG (self, "0 size extent");
 
283
                                                continue;
 
284
                                        }
 
285
 
 
286
                                        current_extent = dvdcss_seek (handle, range->start, DVDCSS_SEEK_KEY);
 
287
                                        if (current_extent != range->start) {
 
288
                                                BRASERO_JOB_LOG (self, "Problem: could not retrieve key");
275
289
                                                g_set_error (error,
276
290
                                                             BRASERO_BURN_ERROR,
277
291
                                                             BRASERO_BURN_ERROR_GENERAL,
282
296
                                }
283
297
                        }
284
298
                }
285
 
                else if (!brasero_dvdcss_create_scrambled_sectors_map (map, handle, file, error))
 
299
                else if (!brasero_dvdcss_create_scrambled_sectors_map (self, map, handle, file, error))
286
300
                        return FALSE;
287
301
        }
288
302
 
362
376
        /* look through the files to get the ranges of encrypted sectors
363
377
         * and cache the CSS keys while at it. */
364
378
        map = g_queue_new ();
365
 
        if (!brasero_dvdcss_create_scrambled_sectors_map (map, handle, files, &priv->error))
 
379
        if (!brasero_dvdcss_create_scrambled_sectors_map (self, map, handle, files, &priv->error))
366
380
                goto end;
367
381
 
 
382
        BRASERO_JOB_LOG (self, "DVD map created (keys retrieved)");
 
383
 
368
384
        g_queue_sort (map, brasero_dvdcss_sort_ranges, NULL);
369
385
 
370
386
        brasero_volume_file_free (files);