/* discoverer-min.c generated by valac 0.11.4, the Vala compiler
 * generated from discoverer-min.vala, do not modify */

/* Compile with valac -g --save-temps --pkg=gstreamer-pbutils-0.10 --pkg=gio-2.0  discoverer.vala*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
#include <gio/gio.h>
#include <stdio.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gst_mini_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_mini_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))



gint _vala_main (gchar** args, int args_length1);


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GstDiscoverer* d;
	GstDiscovererInfo* i;
	GstDiscoverer* _tmp0_ = NULL;
	GstDiscoverer* _tmp1_;
	GstDiscoverer* _tmp2_;
	GFile* _tmp3_ = NULL;
	GFile* _tmp4_;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_;
	gchar* uri;
	GstDiscovererInfo* _tmp7_ = NULL;
	GstDiscovererInfo* _tmp8_;
	GstDiscovererInfo* _tmp9_;
	GError * _inner_error_ = NULL;
	gst_init (&args_length1, &args);
	d = NULL;
	i = NULL;
	_tmp0_ = gst_discoverer_new ((GstClockTime) (10 * GST_SECOND), &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		goto __catch0_g_error;
	}
	_tmp2_ = _tmp1_;
	_g_object_unref0 (d);
	d = _tmp2_;
	_tmp3_ = g_file_new_for_path ("/home/andrew/Music/Andrea Bocelli/Cieli di Toscana/Andrea Bocelli - Ci" \
"eli di Toscana - 03 - E Sara' A Settembre (Someone Like You).mp3");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_file_get_uri (_tmp4_);
	uri = (_tmp6_ = _tmp5_, _g_object_unref0 (_tmp4_), _tmp6_);
	_tmp7_ = gst_discoverer_discover_uri (d, uri, &_inner_error_);
	_tmp8_ = _tmp7_;
	if (_inner_error_ != NULL) {
		_g_free0 (uri);
		goto __catch1_g_error;
	}
	_tmp9_ = _tmp8_;
	_gst_mini_object_unref0 (i);
	i = _tmp9_;
	gst_discoverer_info_get_tags (i);
	_g_free0 (uri);
	goto __finally1;
	__catch1_g_error:
	{
		GError * e;
		gchar* _tmp10_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp10_ = g_strconcat (e->message, "\n", NULL);
		fprintf (stdout, "%s", _tmp10_);
		_g_free0 (_tmp10_);
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		goto __catch0_g_error;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError * e;
		gchar* _tmp11_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp11_ = g_strconcat (e->message, "\n", NULL);
		fprintf (stdout, "%s", _tmp11_);
		_g_free0 (_tmp11_);
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_gst_mini_object_unref0 (i);
		_g_object_unref0 (d);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	result = 0;
	_gst_mini_object_unref0 (i);
	_g_object_unref0 (d);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main (argv, argc);
}



