~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to libbrasero-burn/burn-task-ctx.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Moog
  • Date: 2009-07-28 01:12:27 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 46.
  • Revision ID: james.westby@ubuntu.com-20090728011227-tiva9yorc5d1r5hs
Tags: upstream-2.27.5
ImportĀ upstreamĀ versionĀ 2.27.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
#include "burn-basics.h"
42
42
#include "brasero-session.h"
43
 
#include "brasero-session-helper.h"
44
43
#include "burn-debug.h"
45
44
#include "burn-task-ctx.h"
46
45
 
623
622
        priv->progress_changed = 1;
624
623
 
625
624
        if (priv->use_average_rate) {
626
 
                if (priv->progress < progress)
627
 
                        priv->progress = progress;
628
 
 
 
625
                priv->progress = progress;
629
626
                return BRASERO_BURN_OK;
630
627
        }
631
628
 
632
629
        /* here we prefer to use track written bytes instead of progress.
633
630
         * NOTE: usually plugins will return only one information. */
634
631
        if (priv->last_written) {
635
 
                if (priv->progress < progress)
636
 
                        priv->progress = progress;
 
632
                priv->progress = progress;
637
633
                return BRASERO_BURN_OK;
638
634
        }
639
635
 
648
644
                priv->current_elapsed = elapsed;
649
645
        }
650
646
 
651
 
        if (priv->progress < progress)
652
 
                priv->progress = progress;
653
 
 
654
 
        return BRASERO_BURN_OK;
655
 
}
656
 
 
657
 
BraseroBurnResult
658
 
brasero_task_ctx_reset_progress (BraseroTaskCtx *self)
659
 
{
660
 
        BraseroTaskCtxPrivate *priv;
661
 
 
662
 
        g_return_val_if_fail (BRASERO_IS_TASK_CTX (self), BRASERO_BURN_ERR);
663
 
 
664
 
        priv = BRASERO_TASK_CTX_PRIVATE (self);
665
 
 
666
 
        priv->progress_changed = 1;
667
 
 
668
 
        if (priv->timer) {
669
 
                g_timer_destroy (priv->timer);
670
 
                priv->timer = NULL;
671
 
        }
672
 
 
673
 
        priv->dangerous = 0;
674
 
        priv->progress = -1.0;
675
 
        priv->track_bytes = -1;
676
 
        priv->session_bytes = -1;
677
 
 
678
 
        priv->current_elapsed = 0;
679
 
        priv->last_written = 0;
680
 
        priv->last_elapsed = 0;
681
 
        priv->last_progress = 0;
682
 
 
683
 
        if (priv->times) {
684
 
                g_slist_free (priv->times);
685
 
                priv->times = NULL;
686
 
        }
687
 
 
 
647
        priv->progress = progress;
688
648
        return BRASERO_BURN_OK;
689
649
}
690
650