[Goodies-commits] r5932 - xfburn/trunk/xfburn
David Mohr
squisher at xfce.org
Mon Nov 3 07:55:02 CET 2008
Author: squisher
Date: 2008-11-03 06:55:02 +0000 (Mon, 03 Nov 2008)
New Revision: 5932
Modified:
xfburn/trunk/xfburn/xfburn-error.h
xfburn/trunk/xfburn/xfburn-transcoder-gst.c
Log:
Show gst error to user if not adding
Modified: xfburn/trunk/xfburn/xfburn-error.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-error.h 2008-11-03 06:14:41 UTC (rev 5931)
+++ xfburn/trunk/xfburn/xfburn-error.h 2008-11-03 06:55:02 UTC (rev 5932)
@@ -40,6 +40,7 @@
XFBURN_ERROR_GST_STATE,
XFBURN_ERROR_GST_TIMEOUT,
XFBURN_ERROR_PIPE,
+ XFBURN_ERROR_GST_NO_AUDIO,
} XfburnError;
#define XFBURN_ERROR xfburn_error_quark ()
Modified: xfburn/trunk/xfburn/xfburn-transcoder-gst.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder-gst.c 2008-11-03 06:14:41 UTC (rev 5931)
+++ xfburn/trunk/xfburn/xfburn-transcoder-gst.c 2008-11-03 06:55:02 UTC (rev 5932)
@@ -453,13 +453,13 @@
/* FIXME: show this all the time? */
g_warning ("Gstreamer error: %s\n", error->message);
- g_error_free (error);
switch (priv->state) {
case XFBURN_TRANSCODER_GST_STATE_IDLE:
#if DEBUG_GST > 0
DBG ("Ignoring gstreamer error while idling.");
#endif
+ g_error_free (error);
recreate_pipeline (trans);
break;
@@ -467,12 +467,14 @@
recreate_pipeline (trans);
priv->is_audio = FALSE;
+ priv->error = error;
signal_identification_done (trans, "error");
break;
case XFBURN_TRANSCODER_GST_STATE_TRANSCODE_START:
case XFBURN_TRANSCODER_GST_STATE_TRANSCODING:
+ g_error_free (error);
g_error ("Gstreamer error while transcoding!");
break;
}
@@ -604,12 +606,16 @@
GstMessage *msg;
GstBus *bus;
- DBG ("File content has a decoder but is not audio");
+ gchar *error_msg = "File content has a decoder but is not audio.";
+
+ DBG (error_msg);
gst_caps_unref (caps);
gst_object_unref (audiopad);
priv->is_audio = FALSE;
+ g_set_error (&(priv->error), XFBURN_ERROR, XFBURN_ERROR_GST_NO_AUDIO,
+ _(error_msg));
msg_struct = gst_structure_new ("no-audio-content", NULL);
@@ -678,6 +684,7 @@
return NULL;
*/
}
+
g_get_current_time (&tv);
g_time_val_add (&tv, SIGNAL_WAIT_TIMEOUT_MICROS);
#if DEBUG_GST > 0
@@ -696,7 +703,9 @@
if (!priv->is_audio) {
g_set_error (error, XFBURN_ERROR, XFBURN_ERROR_NOT_AUDIO_FORMAT,
- _("%s is not an audio file"), fn);
+ _("%s\n\tis not an audio file:\n\n%s"), fn, priv->error->message);
+ g_error_free (priv->error);
+ priv->error = NULL;
return NULL;
}
More information about the Goodies-commits
mailing list