diff --git a/brasero.spec b/brasero.spec index 7dddb16..4f64c09 100644 --- a/brasero.spec +++ b/brasero.spec @@ -1,6 +1,6 @@ Name: brasero Version: 2.28.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Gnome CD/DVD burning application Group: Applications/Multimedia License: GPLv2+ @@ -45,6 +45,8 @@ Requires(pre): GConf2 Requires(post): GConf2 Requires(preun): GConf2 +# from upstream +Patch0: eject.patch %description Simple and easy to use CD/DVD burning application for the Gnome @@ -87,7 +89,7 @@ developing brasero applications. %prep %setup -q - +%patch0 -p1 -b .eject %build %configure \ @@ -205,6 +207,9 @@ fi %changelog +* Fri Oct 2 2009 Matthias Clasen - 2.28.0-2 +- Fix ejecting after burning + * Tue Sep 22 2009 Matthias Clasen - 2.28.0-1 - Update to 2.28.0 diff --git a/eject.patch b/eject.patch new file mode 100644 index 0000000..43839e1 --- /dev/null +++ b/eject.patch @@ -0,0 +1,143 @@ +diff --git a/libbrasero-media/brasero-drive.c b/libbrasero-media/brasero-drive.c +index 08ab4e7..f3a7136 100644 +--- a/libbrasero-media/brasero-drive.c ++++ b/libbrasero-media/brasero-drive.c +@@ -810,7 +810,7 @@ brasero_drive_probe_inside_thread (gpointer data) + const gchar *device; + BraseroScsiErrCode code; + BraseroDrivePrivate *priv; +- BraseroDeviceHandle *handle; ++ BraseroDeviceHandle *handle = NULL; + BraseroDrive *drive = BRASERO_DRIVE (data); + + priv = BRASERO_DRIVE_PRIVATE (drive); +@@ -833,13 +833,15 @@ brasero_drive_probe_inside_thread (gpointer data) + handle = brasero_device_handle_open (device, FALSE, &code); + } + +- if (priv->probe_cancelled) { +- BRASERO_MEDIA_LOG ("Open () cancelled"); ++ if (!handle) { ++ BRASERO_MEDIA_LOG ("Open () failed: medium busy"); + goto end; + } + +- if (!handle) { +- BRASERO_MEDIA_LOG ("Open () failed: medium busy"); ++ if (priv->probe_cancelled) { ++ BRASERO_MEDIA_LOG ("Open () cancelled"); ++ ++ brasero_device_handle_close (handle); + goto end; + } + +@@ -848,20 +850,24 @@ brasero_drive_probe_inside_thread (gpointer data) + BRASERO_MEDIA_LOG ("No medium inserted"); + + priv->has_medium = FALSE; ++ ++ brasero_device_handle_close (handle); + goto end; + } + + if (code != BRASERO_SCSI_NOT_READY) { +- brasero_device_handle_close (handle); + BRASERO_MEDIA_LOG ("Device does not respond"); ++ ++ brasero_device_handle_close (handle); + goto end; + } + + sleep (2); + + if (priv->probe_cancelled) { +- brasero_device_handle_close (handle); + BRASERO_MEDIA_LOG ("Device probing cancelled"); ++ ++ brasero_device_handle_close (handle); + goto end; + } + } +diff --git a/libbrasero-media/brasero-medium.c b/libbrasero-media/brasero-medium.c +index 46762d4..88a801d 100644 +--- a/libbrasero-media/brasero-medium.c ++++ b/libbrasero-media/brasero-medium.c +@@ -2978,43 +2978,49 @@ brasero_medium_probe_thread (gpointer self) + handle = brasero_device_handle_open (device, FALSE, &code); + } + +- if (priv->probe_cancelled) ++ if (!handle) { ++ BRASERO_MEDIA_LOG ("Open () failed: medium busy"); + goto end; ++ } + +- if (handle) { +- BRASERO_MEDIA_LOG ("Open () succeeded"); +- +- /* NOTE: if we wanted to know the status we'd need to read the +- * error code variable which is currently NULL */ +- while (brasero_spc1_test_unit_ready (handle, &code) != BRASERO_SCSI_OK) { +- if (code == BRASERO_SCSI_NO_MEDIUM) { +- brasero_device_handle_close (handle); +- BRASERO_MEDIA_LOG ("No medium inserted"); +- priv->info = BRASERO_MEDIUM_NONE; +- goto end; +- } +- else if (code != BRASERO_SCSI_NOT_READY) { +- brasero_device_handle_close (handle); +- BRASERO_MEDIA_LOG ("Device does not respond"); +- goto end; +- } ++ if (priv->probe_cancelled) { ++ brasero_device_handle_close (handle); ++ goto end; ++ } + +- sleep (2); ++ BRASERO_MEDIA_LOG ("Open () succeeded"); + +- if (priv->probe_cancelled) { +- brasero_device_handle_close (handle); +- BRASERO_MEDIA_LOG ("Device probing cancelled"); +- goto end; +- } ++ /* NOTE: if we wanted to know the status we'd need to read the ++ * error code variable which is currently NULL */ ++ while (brasero_spc1_test_unit_ready (handle, &code) != BRASERO_SCSI_OK) { ++ if (code == BRASERO_SCSI_NO_MEDIUM) { ++ BRASERO_MEDIA_LOG ("No medium inserted"); ++ priv->info = BRASERO_MEDIUM_NONE; ++ ++ brasero_device_handle_close (handle); ++ goto end; + } ++ else if (code != BRASERO_SCSI_NOT_READY) { ++ BRASERO_MEDIA_LOG ("Device does not respond"); + +- BRASERO_MEDIA_LOG ("Device ready"); ++ brasero_device_handle_close (handle); ++ goto end; ++ } + +- brasero_medium_init_real (BRASERO_MEDIUM (self), handle); +- brasero_device_handle_close (handle); ++ sleep (2); ++ ++ if (priv->probe_cancelled) { ++ BRASERO_MEDIA_LOG ("Device probing cancelled"); ++ ++ brasero_device_handle_close (handle); ++ goto end; ++ } + } +- else +- BRASERO_MEDIA_LOG ("Open () failed: medium busy"); ++ ++ BRASERO_MEDIA_LOG ("Device ready"); ++ ++ brasero_medium_init_real (BRASERO_MEDIUM (self), handle); ++ brasero_device_handle_close (handle); + + end: +