summaryrefslogtreecommitdiffstats
path: root/ext/audiofile
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-01-18 21:46:58 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-01-18 21:46:58 +0000
commit07ed811a0983771c45faa2f6f76a9fff186db407 (patch)
tree1c0250da756e8b2dce0b660515d72ab1352a11d3 /ext/audiofile
parentb1e81d454192223e58f3225aa44785e940a90fd7 (diff)
downloadgst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.tar.gz
gst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.tar.bz2
gst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.zip
use new error signal and classification
Original commit message from CVS: use new error signal and classification
Diffstat (limited to 'ext/audiofile')
-rw-r--r--ext/audiofile/gstafsink.c29
-rw-r--r--ext/audiofile/gstafsrc.c21
2 files changed, 25 insertions, 25 deletions
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index 02e28f8b..4b4704cb 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -24,7 +24,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#include "gst-libs/gst/gst-i18n-plugin.h"
+
#include <gst/gst.h>
+#include <string.h>
+#include <errno.h>
+
#include "gstafsink.h"
/* elementfactory information */
@@ -32,7 +38,7 @@ static GstElementDetails afsink_details = {
"Audiofile Sink",
"Sink/Audio",
"Write audio streams to disk using libaudiofile",
- "Thomas <thomas@apestaart.org>",
+ "Thomas Vander Stichele <thomas@apestaart.org>",
};
@@ -288,16 +294,6 @@ gst_afsink_open_file (GstAFSink *sink)
g_return_val_if_fail (!GST_FLAG_IS_SET (sink, GST_AFSINK_OPEN), FALSE);
- /* open the file */
-/* we use audiofile now
- sink->file = fopen (sink->filename, "w");
- if (sink->file == NULL) {
- perror ("open");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL));
- return FALSE;
- }
-*/
-
/* get the audio parameters */
g_return_val_if_fail (GST_IS_PAD (sink->sinkpad), FALSE);
caps = GST_PAD_CAPS (sink->sinkpad);
@@ -345,8 +341,9 @@ gst_afsink_open_file (GstAFSink *sink)
sink->file = afOpenFile (sink->filename, "w", outfilesetup);
if (sink->file == AF_NULL_FILEHANDLE)
{
- perror ("open");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL));
+ gst_element_error (sink, RESOURCE, OPEN_WRITE,
+ (_("Could not open file \"%s\" for writing"), sink->filename),
+ ("system error: %s", strerror (errno)));
return FALSE;
}
@@ -367,9 +364,9 @@ gst_afsink_close_file (GstAFSink *sink)
/* if (fclose (sink->file) != 0) */
if (afCloseFile (sink->file) != 0)
{
- g_print ("WARNING: afsink: oops, error closing !\n");
- perror ("close");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("closing file \"", sink->filename, "\"", NULL));
+ gst_element_error (sink, RESOURCE, CLOSE,
+ (_("Error closing file \"%s\""), sink->filename),
+ GST_ERROR_SYSTEM);
}
else {
GST_FLAG_UNSET (sink, GST_AFSINK_OPEN);
diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c
index 7d477ab2..965021c0 100644
--- a/ext/audiofile/gstafsrc.c
+++ b/ext/audiofile/gstafsrc.c
@@ -24,8 +24,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#include "gst-libs/gst/gst-i18n-plugin.h"
#include <gst/gst.h>
#include <gst/audio/audio.h>
+#include <string.h>
+#include <errno.h>
+
#include "gstafsrc.h"
/* elementfactory information */
@@ -305,10 +310,9 @@ gst_afsrc_open_file (GstAFSrc *src)
src->file = afOpenFile (src->filename, "r", AF_NULL_FILESETUP);
if (src->file == AF_NULL_FILEHANDLE)
{
- g_print ("ERROR: gstafsrc: Could not open file %s for reading\n",
- src->filename);
- gst_element_error (GST_ELEMENT (src), g_strconcat ("opening file \"",
- src->filename, "\"", NULL));
+ gst_element_error (src, RESOURCE, OPEN_READ,
+ (_("Could not open file \"%s\" for reading"), src->filename),
+ ("system error: %s", strerror (errno)));
return FALSE;
}
@@ -364,11 +368,10 @@ gst_afsrc_close_file (GstAFSrc *src)
/* if (fclose (src->file) != 0) */
if (afCloseFile (src->file) != 0)
{
- g_print ("WARNING: afsrc: oops, error closing !\n");
- perror ("close");
- gst_element_error (GST_ELEMENT (src), g_strconcat("closing file \"", src->filename, "\"", NULL));
- }
- else {
+ gst_element_error (src, RESOURCE, CLOSE,
+ (_("Error closing file \"%s\""), src->filename),
+ GST_ERROR_SYSTEM);
+ } else {
GST_FLAG_UNSET (src, GST_AFSRC_OPEN);
}
}