[farsight2/master] Have fs_codec_list_from_keyfile return a GError
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:20:32 PST 2008
---
gst-libs/gst/farsight/fs-codec.c | 14 +++++---------
gst-libs/gst/farsight/fs-codec.h | 2 +-
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c
index acac9bb..fd24846 100644
--- a/gst-libs/gst/farsight/fs-codec.c
+++ b/gst-libs/gst/farsight/fs-codec.c
@@ -211,6 +211,7 @@ fs_codec_list_copy (const GList *codec_list)
/**
* fs_codec_list_from_keyfile
* @filename: Name of the #GKeyFile to read the codecs parameters from
+ * @error: location of a #GError, or NULL if no error occured
*
* Reads the content of a #GKeyFile of the following format into
* a #GList of #FsCodec structures.
@@ -229,10 +230,11 @@ fs_codec_list_copy (const GList *codec_list)
* another_param=WOW
* ]|
*
- * Return value: The read #GList of #FsCodec or %NULL if an error appended
+ * Return value: The #GList of #FsCodec or %NULL if the keyfile was empty
+ * or an error occured.
*/
GList *
-fs_codec_list_from_keyfile (const gchar *filename)
+fs_codec_list_from_keyfile (const gchar *filename, GError **error)
{
GKeyFile *keyfile = NULL;
GList *codecs = NULL;
@@ -246,13 +248,7 @@ fs_codec_list_from_keyfile (const gchar *filename)
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile, filename,
- G_KEY_FILE_NONE, &gerror)) {
- if (gerror) {
- g_debug ("Unable to read file %s: %s", filename, gerror->message);
- g_error_free (gerror);
- } else {
- g_warning ("Unknown error reading file %s", filename);
- }
+ G_KEY_FILE_NONE, error)) {
goto out;
}
diff --git a/gst-libs/gst/farsight/fs-codec.h b/gst-libs/gst/farsight/fs-codec.h
index d115fd4..d9cc4a9 100644
--- a/gst-libs/gst/farsight/fs-codec.h
+++ b/gst-libs/gst/farsight/fs-codec.h
@@ -137,7 +137,7 @@ FsCodec *fs_codec_copy (const FsCodec * codec);
void fs_codec_list_destroy (GList *codec_list);
GList *fs_codec_list_copy (const GList *codec_list);
-GList *fs_codec_list_from_keyfile (const gchar *filename);
+GList *fs_codec_list_from_keyfile (const gchar *filename, GError **error);
gchar *fs_codec_to_string (const FsCodec *codec);
gboolean fs_codec_are_equal (const FsCodec *codec1, const FsCodec *codec2);
--
1.5.6.5
More information about the farsight-commits
mailing list