[rhythmbox] encoder: remove output file when being cancelled
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] encoder: remove output file when being cancelled
- Date: Mon, 31 May 2010 10:32:42 +0000 (UTC)
commit f0cd97aa8f79b3566e9619095ada7980d1577da7
Author: Jonathan Matthew <jonathan d14n org>
Date: Mon May 31 20:30:42 2010 +1000
encoder: remove output file when being cancelled
backends/gstreamer/rb-encoder-gst.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/backends/gstreamer/rb-encoder-gst.c b/backends/gstreamer/rb-encoder-gst.c
index 8ab920e..87eefa4 100644
--- a/backends/gstreamer/rb-encoder-gst.c
+++ b/backends/gstreamer/rb-encoder-gst.c
@@ -1024,6 +1024,7 @@ rb_encoder_gst_cancel (RBEncoder *encoder)
if (priv->outstream != NULL) {
GError *error = NULL;
+ GFile *f;
g_output_stream_close (priv->outstream, NULL, &error);
if (error != NULL) {
rb_debug ("error closing output stream: %s", error->message);
@@ -1031,6 +1032,15 @@ rb_encoder_gst_cancel (RBEncoder *encoder)
}
g_object_unref (priv->outstream);
priv->outstream = NULL;
+
+ /* try to delete the output file, since it's incomplete */
+ error = NULL;
+ f = g_file_new_for_uri (priv->dest_uri);
+ if (g_file_delete (f, NULL, &error) == FALSE) {
+ rb_debug ("error deleting incomplete output file: %s", error->message);
+ g_error_free (error);
+ }
+ g_object_unref (f);
}
rb_encoder_gst_emit_completed (RB_ENCODER_GST (encoder));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]