~ubuntu-branches/ubuntu/vivid/brasero/vivid-proposed

« back to all changes in this revision

Viewing changes to src/plugins/cdrkit/burn-wodim.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-09-05 12:11:18 UTC
  • mfrom: (1.3.2 upstream)
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 72.
  • Revision ID: james.westby@ubuntu.com-20090905121118-zbk0riczqn2is008
Tags: 2.26.3-1
[ Josselin Mouette ]
* Recommend cdrdao. Closes: #525140.
* Only use stable versions in watch file.

[ Emilio Pozuelo Monfort ]
* New upstream bugfix release.
  - Don't hang at normalizing tracks. Closes: #533605.
* debian/watch: Don't uupdate.
* debian/patches/090_relibtoolize.patch: Refreshed.
* debian/patches/001_hal_null_pointer_dereference.patch:
  Patch from Rogério Brito to not crash if hal isn't installed.
  Closes: #539624.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
BRASERO_PLUGIN_BOILERPLATE (BraseroWodim, brasero_wodim, BRASERO_TYPE_PROCESS, BraseroProcess);
56
56
 
57
57
struct _BraseroWodimPrivate {
58
 
        gint64 current_track_end_pos;
59
 
        gint64 current_track_written;
 
58
        goffset current_track_end_pos;
 
59
        goffset current_track_written;
60
60
 
61
61
        gint current_track_num;
62
62
        gint track_count;
202
202
 
203
203
static void
204
204
brasero_wodim_compute (BraseroWodim *wodim,
205
 
                       gint mb_written,
206
 
                       gint mb_total,
207
 
                       gint track_num)
 
205
                       goffset mb_written,
 
206
                       goffset mb_total,
 
207
                       goffset track_num)
208
208
{
209
209
        gboolean track_num_changed = FALSE;
210
210
        BraseroWodimPrivate *priv;
211
211
        BraseroJobAction action;
212
 
        gint64 this_remain;
213
 
        gint64 bytes;
214
 
        gint64 total;
 
212
        goffset this_remain;
 
213
        goffset bytes;
 
214
        goffset total;
215
215
 
216
216
        priv = BRASERO_WODIM_PRIVATE (wodim);
217
217
        if (mb_total <= 0)
218
218
                return;
219
219
 
220
 
        total = mb_total * 1048576;
 
220
        total = mb_total * (goffset) 1048576LL;
221
221
 
222
222
        if (track_num > priv->current_track_num) {
223
223
                track_num_changed = TRUE;
224
224
                priv->current_track_num = track_num;
225
 
                priv->current_track_end_pos += mb_total * 1048576;
 
225
                priv->current_track_end_pos += mb_total * (goffset) 1048576LL;
226
226
        }
227
227
 
228
 
        this_remain = (mb_total - mb_written) * 1048576;
 
228
        this_remain = (mb_total - mb_written) * (goffset) 1048576LL;
229
229
        bytes = (total - priv->current_track_end_pos) + this_remain;
230
230
        brasero_job_set_written_session (BRASERO_JOB (wodim), total - bytes);
231
231
 
270
270
                               (gdouble) CD_RATE;
271
271
                brasero_job_set_rate (BRASERO_JOB (wodim), current_rate);
272
272
 
273
 
                priv->current_track_written = mb_written * 1048576;
 
273
                priv->current_track_written = (goffset) mb_written * (goffset) 1048576LL;
274
274
                brasero_wodim_compute (wodim,
275
275
                                       mb_written,
276
276
                                       mb_total,
288
288
                               (gdouble) CD_RATE;
289
289
                brasero_job_set_rate (BRASERO_JOB (wodim), current_rate);
290
290
 
291
 
                priv->current_track_written = mb_written * 1048576;
 
291
                priv->current_track_written = (goffset) mb_written * (goffset) 1048576LL;
292
292
                if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
293
293
                        gint64 bytes = 0;
294
294
 
296
296
                        brasero_job_get_session_output_size (BRASERO_JOB (wodim),
297
297
                                                             NULL,
298
298
                                                             &bytes);
299
 
                        mb_total = bytes / 1048576;
 
299
                        mb_total = bytes / (goffset) 1048576LL;
300
300
                        brasero_wodim_compute (wodim,
301
301
                                               mb_written,
302
302
                                               mb_total,
352
352
        }
353
353
        else if (g_str_has_prefix (line, "Fixating...")
354
354
             ||  g_str_has_prefix (line, "Writing Leadout...")) {
355
 
                brasero_job_set_current_action (BRASERO_JOB (process),
356
 
                                                BRASERO_BURN_ACTION_FIXATING,
357
 
                                                NULL,
358
 
                                                FALSE);
 
355
                BraseroJobAction action;
 
356
 
 
357
                /* Do this to avoid strange things to appear when erasing */
 
358
                brasero_job_get_action (BRASERO_JOB (wodim), &action);
 
359
                if (action == BRASERO_JOB_ACTION_RECORD)
 
360
                        brasero_job_set_current_action (BRASERO_JOB (process),
 
361
                                                        BRASERO_BURN_ACTION_FIXATING,
 
362
                                                        NULL,
 
363
                                                        FALSE);
359
364
        }
360
365
        else if (g_str_has_prefix (line, "Last chance to quit, ")) {
361
366
                brasero_job_set_dangerous (BRASERO_JOB (process), TRUE);