[brasero] Small speed up
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] Small speed up
- Date: Sun, 4 Oct 2009 12:19:12 +0000 (UTC)
commit 40abaed0a89a1da3f693d1d14dce110a6d9993ab
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Sat Sep 26 14:17:05 2009 +0200
Small speed up
Remove some unnecessary tests when getting flags and whether it's supported for CLONE, CDRDAO and CUE image types.
libbrasero-burn/brasero-caps-session.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/libbrasero-burn/brasero-caps-session.c b/libbrasero-burn/brasero-caps-session.c
index c40c7ba..dc64e3e 100644
--- a/libbrasero-burn/brasero-caps-session.c
+++ b/libbrasero-burn/brasero-caps-session.c
@@ -866,6 +866,17 @@ brasero_burn_caps_is_session_supported_same_src_dest (BraseroBurnCaps *self,
if (caps->type.type != BRASERO_TRACK_TYPE_DISC)
continue;
+ /* This type of disc cannot be burnt; skip them */
+ if (caps->type.subtype.media & BRASERO_MEDIUM_ROM)
+ continue;
+
+ /* These three types only work with CDs. Skip the rest. */
+ if ((output.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO
+ || output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE
+ || output.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE)
+ && (caps->type.subtype.media & BRASERO_MEDIUM_CD) == 0)
+ continue;
+
/* Make sure this is supported by the drive */
if (!brasero_drive_can_write_media (burner, caps->type.subtype.media))
continue;
@@ -1653,7 +1664,7 @@ brasero_burn_caps_get_flags_same_src_dest (BraseroBurnCaps *self,
BraseroBurnResult result;
gboolean format_supported;
- /* check this image type is possible given the current flags */
+ /* check if this image type is possible given the current flags */
if (format != BRASERO_IMAGE_FORMAT_CLONE
&& (session_flags & BRASERO_BURN_FLAG_RAW))
continue;
@@ -1687,6 +1698,17 @@ brasero_burn_caps_get_flags_same_src_dest (BraseroBurnCaps *self,
if (caps->type.type != BRASERO_TRACK_TYPE_DISC)
continue;
+ /* This type of disc cannot be burnt; skip them */
+ if (caps->type.subtype.media & BRASERO_MEDIUM_ROM)
+ continue;
+
+ /* These three types only work with CDs. Skip the rest. */
+ if ((output.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO
+ || output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE
+ || output.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE)
+ && (caps->type.subtype.media & BRASERO_MEDIUM_CD) == 0)
+ continue;
+
/* Merge all available flags for each possible medium type */
supported = BRASERO_BURN_FLAG_NONE;
compulsory = BRASERO_BURN_FLAG_NONE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]