perl-GStreamer r109 - in trunk: . xs



Author: tsch
Date: Sat Feb 21 15:41:24 2009
New Revision: 109
URL: http://svn.gnome.org/viewvc/perl-GStreamer?rev=109&view=rev

Log:
(SvGstFormat): Throw an exception if gst_format_get_by_nick failed to convert
the string to a format.  This means that unregistered format strings now cause
errors instead of being silently turned into GST_FORMAT_UNDEFINED.


Modified:
   trunk/ChangeLog
   trunk/xs/GstFormat.xs

Modified: trunk/xs/GstFormat.xs
==============================================================================
--- trunk/xs/GstFormat.xs	(original)
+++ trunk/xs/GstFormat.xs	Sat Feb 21 15:41:24 2009
@@ -44,7 +44,12 @@
 	if (gperl_try_convert_enum (GST_TYPE_FORMAT, sv, (gint *) &format))
 		return format;
 
-	return gst_format_get_by_nick (SvPV_nolen (sv));
+	format = gst_format_get_by_nick (SvPV_nolen (sv));
+	if (GST_FORMAT_UNDEFINED == format)
+		croak ("`%s' is not a valid GstFormat value",
+		       gperl_format_variable_for_output (sv));
+
+	return format;
 }
 
 /* ------------------------------------------------------------------------- */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]