[rygel-gst-0-10-plugins] Some cleanup



commit ad3f3ea46ca40f9cf3c195d9daa1cc2df214d7dc
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jan 28 14:21:03 2013 +0100

    Some cleanup

 src/media-export/rygel-media-export-item-factory.c | 1528 ++++++++------------
 1 files changed, 605 insertions(+), 923 deletions(-)
---
diff --git a/src/media-export/rygel-media-export-item-factory.c b/src/media-export/rygel-media-export-item-factory.c
index 224fbb0..5cb6490 100644
--- a/src/media-export/rygel-media-export-item-factory.c
+++ b/src/media-export/rygel-media-export-item-factory.c
@@ -1,9 +1,7 @@
-/* rygel-media-export-item.c generated by valac 0.18.1, the Vala compiler
- * generated from rygel-media-export-item.vala, do not modify */
-
 /*
  * Copyright (C) 2008 Zeeshan Ali <zeenix gmail com>.
  * Copyright (C) 2008 Nokia Corporation.
+ * Copyright (C) 2013 Intel Corporation
  *
  * Author: Zeeshan Ali <zeenix gmail com>
  *
@@ -31,951 +29,635 @@
 
 #define _gst_structure_free0(var) ((var == NULL) ? NULL : (var = (gst_structure_free (var), NULL)))
 
-RygelMediaItem* rygel_media_export_item_factory_create_simple (RygelMediaContainer* parent, GFile* file, GFileInfo* info) {
-	RygelMediaItem* result = NULL;
-	GFileInfo* _tmp0_;
-	const gchar* _tmp1_ = NULL;
-	gchar* _tmp2_;
-	gchar* title;
-	RygelMediaItem* item = NULL;
-	GFileInfo* _tmp3_;
-	const gchar* _tmp4_ = NULL;
-	gchar* _tmp5_ = NULL;
-	gchar* mime;
-	const gchar* _tmp6_;
-	gboolean _tmp7_ = FALSE;
-	RygelMediaItem* _tmp28_;
-	const gchar* _tmp29_;
-	RygelMediaItem* _tmp30_;
-	GFileInfo* _tmp31_;
-	gint64 _tmp32_ = 0LL;
-	RygelMediaItem* _tmp33_;
-	GFileInfo* _tmp34_;
-	guint64 _tmp35_ = 0ULL;
-	RygelMediaItem* _tmp36_;
-	GFile* _tmp37_;
-	gchar* _tmp38_ = NULL;
-	gchar* _tmp39_;
-	g_return_val_if_fail (parent != NULL, NULL);
-	g_return_val_if_fail (file != NULL, NULL);
-	g_return_val_if_fail (info != NULL, NULL);
-	_tmp0_ = info;
-	_tmp1_ = g_file_info_get_display_name (_tmp0_);
-	_tmp2_ = g_strdup (_tmp1_);
-	title = _tmp2_;
-	_tmp3_ = info;
-	_tmp4_ = g_file_info_get_content_type (_tmp3_);
-	_tmp5_ = g_content_type_get_mime_type (_tmp4_);
-	mime = _tmp5_;
-	_tmp6_ = mime;
-	_tmp7_ = g_str_has_prefix (_tmp6_, "video/");
-	if (_tmp7_) {
-		GFile* _tmp8_;
-		gchar* _tmp9_ = NULL;
-		gchar* _tmp10_;
-		RygelMediaContainer* _tmp11_;
-		const gchar* _tmp12_;
-		RygelMediaExportVideoItem* _tmp13_;
-		_tmp8_ = file;
-		_tmp9_ = rygel_media_export_media_cache_get_id (_tmp8_);
-		_tmp10_ = _tmp9_;
-		_tmp11_ = parent;
-		_tmp12_ = title;
-		_tmp13_ = rygel_media_export_video_item_new (_tmp10_, _tmp11_, _tmp12_, RYGEL_VIDEO_ITEM_UPNP_CLASS);
-		g_object_unref (item);
-		item = (RygelMediaItem*) _tmp13_;
-		g_free (_tmp10_);
-	} else {
-		const gchar* _tmp14_;
-		gboolean _tmp15_ = FALSE;
-		_tmp14_ = mime;
-		_tmp15_ = g_str_has_prefix (_tmp14_, "image/");
-		if (_tmp15_) {
-			GFile* _tmp16_;
-			gchar* _tmp17_ = NULL;
-			gchar* _tmp18_;
-			RygelMediaContainer* _tmp19_;
-			const gchar* _tmp20_;
-			RygelMediaExportPhotoItem* _tmp21_;
-			_tmp16_ = file;
-			_tmp17_ = rygel_media_export_media_cache_get_id (_tmp16_);
-			_tmp18_ = _tmp17_;
-			_tmp19_ = parent;
-			_tmp20_ = title;
-			_tmp21_ = rygel_media_export_photo_item_new (_tmp18_, _tmp19_, _tmp20_, RYGEL_PHOTO_ITEM_UPNP_CLASS);
-			g_object_unref (item);
-			item = (RygelMediaItem*) _tmp21_;
-			g_free (_tmp18_);
-		} else {
-			GFile* _tmp22_;
-			gchar* _tmp23_ = NULL;
-			gchar* _tmp24_;
-			RygelMediaContainer* _tmp25_;
-			const gchar* _tmp26_;
-			RygelMediaExportMusicItem* _tmp27_;
-			_tmp22_ = file;
-			_tmp23_ = rygel_media_export_media_cache_get_id (_tmp22_);
-			_tmp24_ = _tmp23_;
-			_tmp25_ = parent;
-			_tmp26_ = title;
-			_tmp27_ = rygel_media_export_music_item_new (_tmp24_, _tmp25_, _tmp26_, RYGEL_MUSIC_ITEM_UPNP_CLASS);
-			g_object_unref (item);
-			item = (RygelMediaItem*) _tmp27_;
-			g_free (_tmp24_);
-		}
-	}
-	_tmp28_ = item;
-	_tmp29_ = mime;
-	rygel_media_item_set_mime_type (_tmp28_, _tmp29_);
-	_tmp30_ = item;
-	_tmp31_ = info;
-	_tmp32_ = g_file_info_get_size (_tmp31_);
-	rygel_media_item_set_size (_tmp30_, (gint64) _tmp32_);
-	_tmp33_ = item;
-	_tmp34_ = info;
-	_tmp35_ = g_file_info_get_attribute_uint64 (_tmp34_, G_FILE_ATTRIBUTE_TIME_MODIFIED);
-	rygel_media_object_set_modified ((RygelMediaObject*) _tmp33_, _tmp35_);
-	_tmp36_ = item;
-	_tmp37_ = file;
-	_tmp38_ = g_file_get_uri (_tmp37_);
-	_tmp39_ = _tmp38_;
-	rygel_media_item_add_uri (_tmp36_, _tmp39_);
-	g_free (_tmp39_);
-	result = item;
-	g_free (mime);
-	g_free (title);
-	return result;
-}
+RygelMediaItem*
+rygel_media_export_item_factory_create_simple (RygelMediaContainer *parent, GFile *file, GFileInfo *info) {
+  RygelMediaItem *item = NULL;
+  gchar *title = NULL;
+  gchar *mime = NULL;
 
-static void __g_list_free__gst_mini_object_unref0_0 (GList* self) {
-	g_list_foreach (self, (GFunc) gst_mini_object_unref, NULL);
-	g_list_free (self);
-}
+  g_return_val_if_fail (parent, NULL);
+  g_return_val_if_fail (file, NULL);
+  g_return_val_if_fail (info, NULL);
+
+  title =  g_strdup (g_file_info_get_display_name (info));
+  mime = g_content_type_get_mime_type (g_file_info_get_content_type (info));
+
+  if (g_str_has_prefix (mime, "video/")) {
+    gchar *id = rygel_media_export_media_cache_get_id (file);
+    item = RYGEL_MEDIA_ITEM (rygel_media_export_video_item_new (id, parent, title, RYGEL_VIDEO_ITEM_UPNP_CLASS));
+    g_free (id);
+  } else if (g_str_has_prefix (mime, "image/")) {
+    gchar *id = rygel_media_export_media_cache_get_id (file);
+    item = RYGEL_MEDIA_ITEM (rygel_media_export_photo_item_new (id, parent, title, RYGEL_PHOTO_ITEM_UPNP_CLASS));
+    g_free (id);
+  } else /* if (g_str_has_prefix (mime, "audio/") ||
+    g_strcmp0 (mime, "application/ogg") == 0) */ {
+    gchar *id = rygel_media_export_media_cache_get_id (file);
+    item = RYGEL_MEDIA_ITEM (rygel_media_export_music_item_new (id, parent, title, RYGEL_MUSIC_ITEM_UPNP_CLASS));
+    g_free (id);
+  } /* TODO: playlist */
+
+  rygel_media_item_set_mime_type (item, mime);
+  rygel_media_item_set_size (item,
+    (gint64) g_file_info_get_size (info));
+  rygel_media_object_set_modified (RYGEL_MEDIA_OBJECT (item),
+    g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED));
+
+  gchar *uri = g_file_get_uri (file);
+  rygel_media_item_add_uri (item, uri);
+  g_free (uri);
 
+  g_free (mime);
+  g_free (title);
 
-static gpointer _gst_mini_object_ref0 (gpointer self) {
-	return self ? gst_mini_object_ref (self) : NULL;
+  return item;
 }
 
 
-RygelMediaItem* rygel_media_export_item_factory_create_from_info (RygelMediaContainer* parent, GFile* file, GUPnPDLNAInformation* dlna_info, GFileInfo* file_info) {
-	RygelMediaItem* result = NULL;
-	RygelMediaItem* item = NULL;
-	GFile* _tmp0_;
-	gchar* _tmp1_ = NULL;
-	gchar* id;
-	GList* audio_streams = NULL;
-	GList* video_streams = NULL;
-	GUPnPDLNAInformation* _tmp2_;
-	const GstDiscovererInfo* _tmp3_;
-	const GstDiscovererInfo* _tmp4_;
-	GList* _tmp5_ = NULL;
-	GUPnPDLNAInformation* _tmp6_;
-	const GstDiscovererInfo* _tmp7_;
-	const GstDiscovererInfo* _tmp8_;
-	GList* _tmp9_ = NULL;
-	gboolean _tmp10_ = FALSE;
-	GList* _tmp11_;
-	gboolean _tmp13_;
-	gboolean _tmp17_ = FALSE;
-	GList* _tmp18_;
-	gboolean _tmp22_;
-	g_return_val_if_fail (parent != NULL, NULL);
-	g_return_val_if_fail (file != NULL, NULL);
-	g_return_val_if_fail (dlna_info != NULL, NULL);
-	g_return_val_if_fail (file_info != NULL, NULL);
-	_tmp0_ = file;
-	_tmp1_ = rygel_media_export_media_cache_get_id (_tmp0_);
-	id = _tmp1_;
-	_tmp2_ = dlna_info;
-	_tmp3_ = gupnp_dlna_information_get_info (_tmp2_);
-	_tmp4_ = _tmp3_;
-	_tmp5_ = gst_discoverer_info_get_audio_streams ((GstDiscovererInfo *)_tmp4_);
-	__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-	audio_streams = _tmp5_;
-	_tmp6_ = dlna_info;
-	_tmp7_ = gupnp_dlna_information_get_info (_tmp6_);
-	_tmp8_ = _tmp7_;
-	_tmp9_ = gst_discoverer_info_get_video_streams ((GstDiscovererInfo *)_tmp8_);
-	__g_list_free__gst_mini_object_unref0_0 (video_streams);
-	video_streams = _tmp9_;
-	_tmp11_ = audio_streams;
-	if (_tmp11_ == NULL) {
-		GList* _tmp12_;
-		_tmp12_ = video_streams;
-		_tmp10_ = _tmp12_ == NULL;
-	} else {
-		_tmp10_ = FALSE;
-	}
-	_tmp13_ = _tmp10_;
-	if (_tmp13_) {
-		GFile* _tmp14_;
-		gchar* _tmp15_ = NULL;
-		gchar* _tmp16_;
-		_tmp14_ = file;
-		_tmp15_ = g_file_get_uri (_tmp14_);
-		_tmp16_ = _tmp15_;
-		g_debug ("%s had neither audio nor video/picture " "streams. Ignoring.", _tmp16_);
-		g_free (_tmp16_);
-		result = NULL;
-		__g_list_free__gst_mini_object_unref0_0 (video_streams);
-		__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-		g_free (id);
-		g_object_unref (item);
-		return result;
-	}
-	_tmp18_ = audio_streams;
-	if (_tmp18_ == NULL) {
-		GList* _tmp19_;
-		gconstpointer _tmp20_;
-		gboolean _tmp21_ = FALSE;
-		_tmp19_ = video_streams;
-		_tmp20_ = _tmp19_->data;
-		_tmp21_ = gst_discoverer_video_info_is_image ((GstDiscovererVideoInfo*) _tmp20_);
-		_tmp17_ = _tmp21_;
-	} else {
-		_tmp17_ = FALSE;
-	}
-	_tmp22_ = _tmp17_;
-	if (_tmp22_) {
-		const gchar* _tmp23_;
-		RygelMediaContainer* _tmp24_;
-		RygelMediaExportPhotoItem* _tmp25_;
-		RygelMediaItem* _tmp26_;
-		GFile* _tmp27_;
-		GUPnPDLNAInformation* _tmp28_;
-		GList* _tmp29_;
-		gconstpointer _tmp30_;
-		GFileInfo* _tmp31_;
-		RygelMediaItem* _tmp32_ = NULL;
-		_tmp23_ = id;
-		_tmp24_ = parent;
-		_tmp25_ = rygel_media_export_photo_item_new (_tmp23_, _tmp24_, "", RYGEL_PHOTO_ITEM_UPNP_CLASS);
-		g_object_unref (item);
-		item = (RygelMediaItem*) _tmp25_;
-		_tmp26_ = item;
-		_tmp27_ = file;
-		_tmp28_ = dlna_info;
-		_tmp29_ = video_streams;
-		_tmp30_ = _tmp29_->data;
-		_tmp31_ = file_info;
-		_tmp32_ = rygel_media_export_item_factory_fill_photo_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, RYGEL_MEDIA_EXPORT_TYPE_PHOTO_ITEM) ? ((RygelMediaExportPhotoItem*) _tmp26_) : NULL, _tmp27_, _tmp28_, (GstDiscovererVideoInfo*) _tmp30_, _tmp31_);
-		result = _tmp32_;
-		__g_list_free__gst_mini_object_unref0_0 (video_streams);
-		__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-		g_free (id);
-		g_object_unref (item);
-		return result;
-	} else {
-		GList* _tmp33_;
-		_tmp33_ = video_streams;
-		if (_tmp33_ != NULL) {
-			const gchar* _tmp34_;
-			RygelMediaContainer* _tmp35_;
-			RygelMediaExportVideoItem* _tmp36_;
-			GstDiscovererAudioInfo* _tmp37_;
-			GstDiscovererAudioInfo* audio_info;
-			GList* _tmp38_;
-			RygelMediaItem* _tmp42_;
-			GFile* _tmp43_;
-			GUPnPDLNAInformation* _tmp44_;
-			GList* _tmp45_;
-			gconstpointer _tmp46_;
-			GstDiscovererAudioInfo* _tmp47_;
-			GFileInfo* _tmp48_;
-			RygelMediaItem* _tmp49_ = NULL;
-			_tmp34_ = id;
-			_tmp35_ = parent;
-			_tmp36_ = rygel_media_export_video_item_new (_tmp34_, _tmp35_, "", RYGEL_VIDEO_ITEM_UPNP_CLASS);
-			g_object_unref (item);
-			item = (RygelMediaItem*) _tmp36_;
-			_tmp37_ = _gst_mini_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (NULL, GST_TYPE_DISCOVERER_AUDIO_INFO) ? ((GstDiscovererAudioInfo*) NULL) : NULL);
-			audio_info = _tmp37_;
-			_tmp38_ = audio_streams;
-			if (_tmp38_ != NULL) {
-				GList* _tmp39_;
-				gconstpointer _tmp40_;
-				GstDiscovererAudioInfo* _tmp41_;
-				_tmp39_ = audio_streams;
-				_tmp40_ = _tmp39_->data;
-				_tmp41_ = _gst_mini_object_ref0 ((GstDiscovererAudioInfo*) _tmp40_);
-				gst_mini_object_unref (GST_MINI_OBJECT (audio_info));
-				audio_info = _tmp41_;
-			}
-			_tmp42_ = item;
-			_tmp43_ = file;
-			_tmp44_ = dlna_info;
-			_tmp45_ = video_streams;
-			_tmp46_ = _tmp45_->data;
-			_tmp47_ = audio_info;
-			_tmp48_ = file_info;
-			_tmp49_ = rygel_media_export_item_factory_fill_video_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, RYGEL_MEDIA_EXPORT_TYPE_VIDEO_ITEM) ? ((RygelMediaExportVideoItem*) _tmp42_) : NULL, _tmp43_, _tmp44_, (GstDiscovererVideoInfo*) _tmp46_, _tmp47_, _tmp48_);
-			result = _tmp49_;
-			gst_mini_object_unref (GST_MINI_OBJECT (audio_info));
-			__g_list_free__gst_mini_object_unref0_0 (video_streams);
-			__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-			g_free (id);
-			g_object_unref (item);
-			return result;
-		} else {
-			GList* _tmp50_;
-			_tmp50_ = audio_streams;
-			if (_tmp50_ != NULL) {
-				const gchar* _tmp51_;
-				RygelMediaContainer* _tmp52_;
-				RygelMediaExportMusicItem* _tmp53_;
-				RygelMediaItem* _tmp54_;
-				GFile* _tmp55_;
-				GUPnPDLNAInformation* _tmp56_;
-				GList* _tmp57_;
-				gconstpointer _tmp58_;
-				GFileInfo* _tmp59_;
-				RygelMediaItem* _tmp60_ = NULL;
-				_tmp51_ = id;
-				_tmp52_ = parent;
-				_tmp53_ = rygel_media_export_music_item_new (_tmp51_, _tmp52_, "", RYGEL_MUSIC_ITEM_UPNP_CLASS);
-				g_object_unref (item);
-				item = (RygelMediaItem*) _tmp53_;
-				_tmp54_ = item;
-				_tmp55_ = file;
-				_tmp56_ = dlna_info;
-				_tmp57_ = audio_streams;
-				_tmp58_ = _tmp57_->data;
-				_tmp59_ = file_info;
-				_tmp60_ = rygel_media_export_item_factory_fill_music_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp54_, RYGEL_MEDIA_EXPORT_TYPE_MUSIC_ITEM) ? ((RygelMediaExportMusicItem*) _tmp54_) : NULL, _tmp55_, _tmp56_, (GstDiscovererAudioInfo*) _tmp58_, _tmp59_);
-				result = _tmp60_;
-				__g_list_free__gst_mini_object_unref0_0 (video_streams);
-				__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-				g_free (id);
-				g_object_unref (item);
-				return result;
-			} else {
-				result = NULL;
-				__g_list_free__gst_mini_object_unref0_0 (video_streams);
-				__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-				g_free (id);
-				g_object_unref (item);
-				return result;
-			}
-		}
-	}
-	__g_list_free__gst_mini_object_unref0_0 (video_streams);
-	__g_list_free__gst_mini_object_unref0_0 (audio_streams);
-	g_free (id);
-	g_object_unref (item);
+RygelMediaItem*
+rygel_media_export_item_factory_create_from_info (RygelMediaContainer *parent, GFile *file, GUPnPDLNAInformation *dlna_info, GFileInfo *file_info) {
+  RygelMediaItem *result = NULL;
+  gchar *id = NULL;
+  const GstDiscovererInfo *discoverer_info = NULL;
+  GList *audio_streams = NULL;
+  GList *video_streams = NULL;
+
+  g_return_val_if_fail (parent, NULL);
+  g_return_val_if_fail (file, NULL);
+  g_return_val_if_fail (dlna_info, NULL);
+  g_return_val_if_fail (file_info, NULL);
+
+  id = rygel_media_export_media_cache_get_id (file);
+  discoverer_info = gupnp_dlna_information_get_info (dlna_info);
+
+  audio_streams = gst_discoverer_info_get_audio_streams ((GstDiscovererInfo *)dlna_info);
+  video_streams = gst_discoverer_info_get_video_streams ((GstDiscovererInfo *)dlna_info);
+
+  if( !audio_streams && !video_streams) {
+    gchar *uri = g_file_get_uri (file);
+    g_debug ("%s had neither audio nor video/picture " "streams. Ignoring.", uri);
+    g_free (uri);
+
+    result = NULL;
+  } else if (!audio_streams &&
+    gst_discoverer_video_info_is_image ((GstDiscovererVideoInfo*) video_streams->data)) {
+    RygelMediaExportPhotoItem *item = rygel_media_export_photo_item_new (id, parent, "", RYGEL_PHOTO_ITEM_UPNP_CLASS);
+    result = rygel_media_export_item_factory_fill_photo_item (item, file, dlna_info, (GstDiscovererVideoInfo*) video_streams->data, file_info);
+  } else if (video_streams) {
+    RygelMediaExportVideoItem *item = rygel_media_export_video_item_new (id, parent, "", RYGEL_VIDEO_ITEM_UPNP_CLASS);
+
+    GstDiscovererAudioInfo *audio_info = NULL;
+    if(audio_streams) {
+      audio_info = (GstDiscovererAudioInfo*) audio_streams->data;
+    }
+
+    result = rygel_media_export_item_factory_fill_video_item (item, file, dlna_info, (GstDiscovererVideoInfo*) video_streams->data, audio_info, file_info);
+  } else if (audio_streams) {
+    RygelMediaExportMusicItem *item = rygel_media_export_music_item_new (id, parent, "", RYGEL_MUSIC_ITEM_UPNP_CLASS);
+    result = rygel_media_export_item_factory_fill_music_item (item, file, dlna_info, (GstDiscovererAudioInfo*) audio_streams->data, file_info);
+  } else {
+    result = NULL;
+  }
+
+  g_list_foreach (audio_streams, (GFunc) gst_mini_object_unref, NULL);
+  g_list_free (audio_streams);
+
+  g_list_foreach (video_streams, (GFunc) gst_mini_object_unref, NULL);
+  g_list_free (video_streams);
+
+  g_free (id);
+
+  return result;
 }
 
 
-void rygel_media_export_item_factory_fill_audio_item (RygelAudioItem* item, GUPnPDLNAInformation* dlna_info, GstDiscovererAudioInfo* audio_info) {
-	GUPnPDLNAInformation* _tmp0_;
-	const GstDiscovererInfo* _tmp1_;
-	const GstDiscovererInfo* _tmp2_;
-	GstClockTime _tmp3_ = 0ULL;
-	GstDiscovererAudioInfo* _tmp10_;
-	g_return_if_fail (item != NULL);
-	g_return_if_fail (dlna_info != NULL);
-	_tmp0_ = dlna_info;
-	_tmp1_ = gupnp_dlna_information_get_info (_tmp0_);
-	_tmp2_ = _tmp1_;
-	_tmp3_ = gst_discoverer_info_get_duration (_tmp2_);
-	if (_tmp3_ > ((GstClockTime) 0)) {
-		RygelAudioItem* _tmp4_;
-		GUPnPDLNAInformation* _tmp5_;
-		const GstDiscovererInfo* _tmp6_;
-		const GstDiscovererInfo* _tmp7_;
-		GstClockTime _tmp8_ = 0ULL;
-		_tmp4_ = item;
-		_tmp5_ = dlna_info;
-		_tmp6_ = gupnp_dlna_information_get_info (_tmp5_);
-		_tmp7_ = _tmp6_;
-		_tmp8_ = gst_discoverer_info_get_duration (_tmp7_);
-		rygel_audio_item_set_duration (_tmp4_, (glong) (_tmp8_ / GST_SECOND));
-	} else {
-		RygelAudioItem* _tmp9_;
-		_tmp9_ = item;
-		rygel_audio_item_set_duration (_tmp9_, (glong) (-1));
-	}
-	_tmp10_ = audio_info;
-	if (_tmp10_ != NULL) {
-		GstDiscovererAudioInfo* _tmp11_;
-		const GstTagList* _tmp12_ = NULL;
-		RygelAudioItem* _tmp18_;
-		GstDiscovererAudioInfo* _tmp19_;
-		guint _tmp20_ = 0U;
-		RygelAudioItem* _tmp21_;
-		GstDiscovererAudioInfo* _tmp22_;
-		guint _tmp23_ = 0U;
-		_tmp11_ = audio_info;
-		_tmp12_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp11_);
-		if (_tmp12_ != NULL) {
-			guint tmp = 0U;
-			GstDiscovererAudioInfo* _tmp13_;
-			const GstTagList* _tmp14_ = NULL;
-			guint _tmp15_ = 0U;
-			RygelAudioItem* _tmp16_;
-			guint _tmp17_;
-			_tmp13_ = audio_info;
-			_tmp14_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp13_);
-			gst_tag_list_get_uint (_tmp14_, GST_TAG_BITRATE, &_tmp15_);
-			tmp = _tmp15_;
-			_tmp16_ = item;
-			_tmp17_ = tmp;
-			rygel_audio_item_set_bitrate (_tmp16_, ((gint) _tmp17_) / 8);
-		}
-		_tmp18_ = item;
-		_tmp19_ = audio_info;
-		_tmp20_ = gst_discoverer_audio_info_get_channels (_tmp19_);
-		rygel_audio_item_set_channels (_tmp18_, (gint) _tmp20_);
-		_tmp21_ = item;
-		_tmp22_ = audio_info;
-		_tmp23_ = gst_discoverer_audio_info_get_sample_rate (_tmp22_);
-		rygel_audio_item_set_sample_freq (_tmp21_, (gint) _tmp23_);
-	}
+void rygel_media_export_item_factory_fill_audio_item (RygelAudioItem *item, GUPnPDLNAInformation *dlna_info, GstDiscovererAudioInfo *audio_info) {
+  g_return_if_fail (item);
+  g_return_if_fail (dlna_info);
+
+  const GstDiscovererInfo *info = gupnp_dlna_information_get_info (dlna_info);
+  GstClockTime duration = gst_discoverer_info_get_duration (info);
+  if (duration > (GstClockTime) 0) {
+    rygel_audio_item_set_duration (item, (glong) (duration / GST_SECOND));
+  } else {
+    rygel_audio_item_set_duration (item, (glong) (-1));
+  }
+
+  if (audio_info) {
+    const GstTagList *tags = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) audio_info);
+    if (tags) {
+      guint tmp = 0U;
+      gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &tmp);
+
+      rygel_audio_item_set_bitrate (item, (gint) tmp / 8);
+    }
+
+    rygel_audio_item_set_channels (item,
+      (gint) gst_discoverer_audio_info_get_channels (audio_info)); 
+    rygel_audio_item_set_sample_freq (item,
+      (gint) gst_discoverer_audio_info_get_sample_rate (audio_info));
+  }
 }
 
 
-RygelMediaItem* rygel_media_export_item_factory_fill_video_item (RygelMediaExportVideoItem* item, GFile* file, GUPnPDLNAInformation* dlna_info, GstDiscovererVideoInfo* video_info, GstDiscovererAudioInfo* audio_info, GFileInfo* file_info) {
-	RygelMediaItem* result = NULL;
-	RygelMediaExportVideoItem* _tmp0_;
-	GUPnPDLNAInformation* _tmp1_;
-	GstDiscovererAudioInfo* _tmp2_;
-	RygelMediaExportVideoItem* _tmp3_;
-	GFile* _tmp4_;
-	GUPnPDLNAInformation* _tmp5_;
-	GFileInfo* _tmp6_;
-	RygelMediaExportVideoItem* _tmp7_;
-	GstDiscovererVideoInfo* _tmp8_;
-	guint _tmp9_ = 0U;
-	RygelMediaExportVideoItem* _tmp10_;
-	GstDiscovererVideoInfo* _tmp11_;
-	guint _tmp12_ = 0U;
-	GstDiscovererVideoInfo* _tmp13_;
-	guint _tmp14_ = 0U;
-	gint color_depth;
-	gint _tmp15_ = 0;
-	gint _tmp16_;
-	RygelMediaExportVideoItem* _tmp18_;
-	gint _tmp19_;
-	RygelMediaExportVideoItem* _tmp20_;
-	RygelMediaItem* _tmp21_;
-	g_return_val_if_fail (item != NULL, NULL);
-	g_return_val_if_fail (file != NULL, NULL);
-	g_return_val_if_fail (dlna_info != NULL, NULL);
-	g_return_val_if_fail (video_info != NULL, NULL);
-	g_return_val_if_fail (file_info != NULL, NULL);
-	_tmp0_ = item;
-	_tmp1_ = dlna_info;
-	_tmp2_ = audio_info;
-	rygel_media_export_item_factory_fill_audio_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, RYGEL_TYPE_AUDIO_ITEM) ? ((RygelAudioItem*) _tmp0_) : NULL, _tmp1_, _tmp2_);
-	_tmp3_ = item;
-	_tmp4_ = file;
-	_tmp5_ = dlna_info;
-	_tmp6_ = file_info;
-	rygel_media_export_item_factory_fill_media_item ((RygelMediaItem*) _tmp3_, _tmp4_, _tmp5_, _tmp6_);
-	_tmp7_ = item;
-	_tmp8_ = video_info;
-	_tmp9_ = gst_discoverer_video_info_get_width (_tmp8_);
-	rygel_visual_item_set_width ((RygelVisualItem*) _tmp7_, (gint) _tmp9_);
-	_tmp10_ = item;
-	_tmp11_ = video_info;
-	_tmp12_ = gst_discoverer_video_info_get_height (_tmp11_);
-	rygel_visual_item_set_height ((RygelVisualItem*) _tmp10_, (gint) _tmp12_);
-	_tmp13_ = video_info;
-	_tmp14_ = gst_discoverer_video_info_get_depth (_tmp13_);
-	color_depth = (gint) _tmp14_;
-	_tmp16_ = color_depth;
-	if (_tmp16_ == 0) {
-		_tmp15_ = -1;
-	} else {
-		gint _tmp17_;
-		_tmp17_ = color_depth;
-		_tmp15_ = _tmp17_;
-	}
-	_tmp18_ = item;
-	_tmp19_ = _tmp15_;
-	rygel_visual_item_set_color_depth ((RygelVisualItem*) _tmp18_, _tmp19_);
-	_tmp20_ = item;
-	_tmp21_ = g_object_ref ((RygelMediaItem*) _tmp20_);
-	result = _tmp21_;
-	return result;
+RygelMediaItem *rygel_media_export_item_factory_fill_video_item (RygelMediaExportVideoItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GstDiscovererVideoInfo *video_info, GstDiscovererAudioInfo *audio_info, GFileInfo *file_info) {
+  g_return_val_if_fail (item, NULL);
+  g_return_val_if_fail (file, NULL);
+  g_return_val_if_fail (dlna_info, NULL);
+  g_return_val_if_fail (video_info, NULL);
+  g_return_val_if_fail (file_info, NULL);
+
+  rygel_media_export_item_factory_fill_audio_item (RYGEL_AUDIO_ITEM (item), dlna_info, audio_info);
+  rygel_media_export_item_factory_fill_media_item (RYGEL_MEDIA_ITEM (item), file, dlna_info, file_info);
+
+  rygel_visual_item_set_width (RYGEL_VISUAL_ITEM (item),
+    (gint) gst_discoverer_video_info_get_width (video_info));
+  rygel_visual_item_set_height (RYGEL_VISUAL_ITEM (item),
+    (gint) gst_discoverer_video_info_get_height (video_info));
+
+  gint color_depth = gst_discoverer_video_info_get_depth (video_info);
+  rygel_visual_item_set_color_depth (RYGEL_VISUAL_ITEM (item),
+    color_depth == 0 ? -1 : color_depth );
+
+  return RYGEL_MEDIA_ITEM (item);
 }
 
 
-RygelMediaItem* rygel_media_export_item_factory_fill_photo_item (RygelMediaExportPhotoItem* item, GFile* file, GUPnPDLNAInformation* dlna_info, GstDiscovererVideoInfo* video_info, GFileInfo* file_info) {
-	RygelMediaItem* result = NULL;
-	RygelMediaExportPhotoItem* _tmp0_;
-	GFile* _tmp1_;
-	GUPnPDLNAInformation* _tmp2_;
-	GFileInfo* _tmp3_;
-	RygelMediaExportPhotoItem* _tmp4_;
-	GstDiscovererVideoInfo* _tmp5_;
-	guint _tmp6_ = 0U;
-	RygelMediaExportPhotoItem* _tmp7_;
-	GstDiscovererVideoInfo* _tmp8_;
-	guint _tmp9_ = 0U;
-	GstDiscovererVideoInfo* _tmp10_;
-	guint _tmp11_ = 0U;
-	gint color_depth;
-	gint _tmp12_ = 0;
-	gint _tmp13_;
-	RygelMediaExportPhotoItem* _tmp15_;
-	gint _tmp16_;
-	RygelMediaExportPhotoItem* _tmp17_;
-	RygelMediaItem* _tmp18_;
-	g_return_val_if_fail (item != NULL, NULL);
-	g_return_val_if_fail (file != NULL, NULL);
-	g_return_val_if_fail (dlna_info != NULL, NULL);
-	g_return_val_if_fail (video_info != NULL, NULL);
-	g_return_val_if_fail (file_info != NULL, NULL);
-	_tmp0_ = item;
-	_tmp1_ = file;
-	_tmp2_ = dlna_info;
-	_tmp3_ = file_info;
-	rygel_media_export_item_factory_fill_media_item ((RygelMediaItem*) _tmp0_, _tmp1_, _tmp2_, _tmp3_);
-	_tmp4_ = item;
-	_tmp5_ = video_info;
-	_tmp6_ = gst_discoverer_video_info_get_width (_tmp5_);
-	rygel_visual_item_set_width ((RygelVisualItem*) _tmp4_, (gint) _tmp6_);
-	_tmp7_ = item;
-	_tmp8_ = video_info;
-	_tmp9_ = gst_discoverer_video_info_get_height (_tmp8_);
-	rygel_visual_item_set_height ((RygelVisualItem*) _tmp7_, (gint) _tmp9_);
-	_tmp10_ = video_info;
-	_tmp11_ = gst_discoverer_video_info_get_depth (_tmp10_);
-	color_depth = (gint) _tmp11_;
-	_tmp13_ = color_depth;
-	if (_tmp13_ == 0) {
-		_tmp12_ = -1;
-	} else {
-		gint _tmp14_;
-		_tmp14_ = color_depth;
-		_tmp12_ = _tmp14_;
-	}
-	_tmp15_ = item;
-	_tmp16_ = _tmp12_;
-	rygel_visual_item_set_color_depth ((RygelVisualItem*) _tmp15_, _tmp16_);
-	_tmp17_ = item;
-	_tmp18_ = g_object_ref ((RygelMediaItem*) _tmp17_);
-	result = _tmp18_;
-	return result;
+RygelMediaItem *rygel_media_export_item_factory_fill_photo_item (RygelMediaExportPhotoItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GstDiscovererVideoInfo *video_info, GFileInfo *file_info) {
+  RygelMediaItem *result = NULL;
+  RygelMediaExportPhotoItem *_tmp0_;
+  GFile *_tmp1_;
+  GUPnPDLNAInformation *_tmp2_;
+  GFileInfo *_tmp3_;
+  RygelMediaExportPhotoItem *_tmp4_;
+  GstDiscovererVideoInfo *_tmp5_;
+  guint _tmp6_ = 0U;
+  RygelMediaExportPhotoItem *_tmp7_;
+  GstDiscovererVideoInfo *_tmp8_;
+  guint _tmp9_ = 0U;
+  GstDiscovererVideoInfo *_tmp10_;
+  guint _tmp11_ = 0U;
+  gint color_depth;
+  gint _tmp12_ = 0;
+  gint _tmp13_;
+  RygelMediaExportPhotoItem *_tmp15_;
+  gint _tmp16_;
+  RygelMediaExportPhotoItem *_tmp17_;
+  RygelMediaItem *_tmp18_;
+  g_return_val_if_fail (item, NULL);
+  g_return_val_if_fail (file, NULL);
+  g_return_val_if_fail (dlna_info, NULL);
+  g_return_val_if_fail (video_info, NULL);
+  g_return_val_if_fail (file_info, NULL);
+  _tmp0_ = item;
+  _tmp1_ = file;
+  _tmp2_ = dlna_info;
+  _tmp3_ = file_info;
+  rygel_media_export_item_factory_fill_media_item ((RygelMediaItem*) _tmp0_, _tmp1_, _tmp2_, _tmp3_);
+  _tmp4_ = item;
+  _tmp5_ = video_info;
+  _tmp6_ = gst_discoverer_video_info_get_width (_tmp5_);
+  rygel_visual_item_set_width ((RygelVisualItem*) _tmp4_, (gint) _tmp6_);
+  _tmp7_ = item;
+  _tmp8_ = video_info;
+  _tmp9_ = gst_discoverer_video_info_get_height (_tmp8_);
+  rygel_visual_item_set_height ((RygelVisualItem*) _tmp7_, (gint) _tmp9_);
+  _tmp10_ = video_info;
+  _tmp11_ = gst_discoverer_video_info_get_depth (_tmp10_);
+  color_depth = (gint) _tmp11_;
+  _tmp13_ = color_depth;
+  if (_tmp13_ == 0) {
+    _tmp12_ = -1;
+  } else {
+    gint _tmp14_;
+    _tmp14_ = color_depth;
+    _tmp12_ = _tmp14_;
+  }
+  _tmp15_ = item;
+  _tmp16_ = _tmp12_;
+  rygel_visual_item_set_color_depth ((RygelVisualItem*) _tmp15_, _tmp16_);
+  _tmp17_ = item;
+  _tmp18_ = g_object_ref ((RygelMediaItem*) _tmp17_);
+  result = _tmp18_;
+  return result;
 }
 
 
 static gpointer _gst_structure_copy0 (gconstpointer self) {
-	return self ? gst_structure_copy (self) : NULL;
+  return self ? gst_structure_copy (self) : NULL;
 }
 
 
-RygelMediaItem* rygel_media_export_item_factory_fill_music_item (RygelMediaExportMusicItem* item, GFile* file, GUPnPDLNAInformation* dlna_info, GstDiscovererAudioInfo* audio_info, GFileInfo* file_info) {
-	RygelMediaItem* result = NULL;
-	RygelMediaExportMusicItem* _tmp0_;
-	GUPnPDLNAInformation* _tmp1_;
-	GstDiscovererAudioInfo* _tmp2_;
-	RygelMediaExportMusicItem* _tmp3_;
-	GFile* _tmp4_;
-	GUPnPDLNAInformation* _tmp5_;
-	GFileInfo* _tmp6_;
-	GstDiscovererAudioInfo* _tmp7_;
-	RygelMediaExportMusicItem* _tmp64_;
-	RygelMediaItem* _tmp65_;
-	GError * _inner_error_ = NULL;
-	g_return_val_if_fail (item != NULL, NULL);
-	g_return_val_if_fail (file != NULL, NULL);
-	g_return_val_if_fail (dlna_info != NULL, NULL);
-	g_return_val_if_fail (file_info != NULL, NULL);
-	_tmp0_ = item;
-	_tmp1_ = dlna_info;
-	_tmp2_ = audio_info;
-	rygel_media_export_item_factory_fill_audio_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, RYGEL_TYPE_AUDIO_ITEM) ? ((RygelAudioItem*) _tmp0_) : NULL, _tmp1_, _tmp2_);
-	_tmp3_ = item;
-	_tmp4_ = file;
-	_tmp5_ = dlna_info;
-	_tmp6_ = file_info;
-	rygel_media_export_item_factory_fill_media_item ((RygelMediaItem*) _tmp3_, _tmp4_, _tmp5_, _tmp6_);
-	_tmp7_ = audio_info;
-	if (_tmp7_ != NULL) {
-		GstDiscovererAudioInfo* _tmp8_;
-		const GstTagList* _tmp9_ = NULL;
-		gchar* artist = NULL;
-		GUPnPDLNAInformation* _tmp29_;
-		const GstDiscovererInfo* _tmp30_;
-		const GstDiscovererInfo* _tmp31_;
-		const GstTagList* _tmp32_ = NULL;
-		gchar* _tmp33_ = NULL;
-		RygelMediaExportMusicItem* _tmp34_;
-		const gchar* _tmp35_;
-		gchar* album = NULL;
-		GUPnPDLNAInformation* _tmp36_;
-		const GstDiscovererInfo* _tmp37_;
-		const GstDiscovererInfo* _tmp38_;
-		const GstTagList* _tmp39_ = NULL;
-		gchar* _tmp40_ = NULL;
-		RygelMediaExportMusicItem* _tmp41_;
-		const gchar* _tmp42_;
-		gchar* genre = NULL;
-		GUPnPDLNAInformation* _tmp43_;
-		const GstDiscovererInfo* _tmp44_;
-		const GstDiscovererInfo* _tmp45_;
-		const GstTagList* _tmp46_ = NULL;
-		gchar* _tmp47_ = NULL;
-		RygelMediaExportMusicItem* _tmp48_;
-		const gchar* _tmp49_;
-		guint tmp = 0U;
-		GUPnPDLNAInformation* _tmp50_;
-		const GstDiscovererInfo* _tmp51_;
-		const GstDiscovererInfo* _tmp52_;
-		const GstTagList* _tmp53_ = NULL;
-		guint _tmp54_ = 0U;
-		RygelMediaExportMusicItem* _tmp55_;
-		guint _tmp56_;
-		GUPnPDLNAInformation* _tmp57_;
-		const GstDiscovererInfo* _tmp58_;
-		const GstDiscovererInfo* _tmp59_;
-		const GstTagList* _tmp60_ = NULL;
-		guint _tmp61_ = 0U;
-		RygelMediaExportMusicItem* _tmp62_;
-		guint _tmp63_;
-		_tmp8_ = audio_info;
-		_tmp9_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp8_);
-		if (_tmp9_ != NULL) {
-			GstBuffer* buffer = NULL;
-			GstDiscovererAudioInfo* _tmp10_;
-			const GstTagList* _tmp11_ = NULL;
-			GstBuffer* _tmp12_ = NULL;
-			GstBuffer* _tmp13_;
-			_tmp10_ = audio_info;
-			_tmp11_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp10_);
-			gst_tag_list_get_buffer (_tmp11_, GST_TAG_IMAGE, &_tmp12_);
-			buffer = _tmp12_;
-			_tmp13_ = buffer;
-			if (_tmp13_ != NULL) {
-				GstBuffer* _tmp14_;
-				GstCaps* _tmp15_;
-				const GstStructure* _tmp16_ = NULL;
-				GstStructure* _tmp17_;
-				GstStructure* structure;
-				gint image_type = 0;
-				const GstStructure* _tmp18_;
-				gint _tmp19_ = 0;
-				gint _tmp20_;
-				_tmp14_ = buffer;
-				_tmp15_ = _tmp14_->caps;
-				_tmp16_ = gst_caps_get_structure (_tmp15_, (guint) 0);
-				_tmp17_ = _gst_structure_copy0 (_tmp16_);
-				structure = _tmp17_;
-				_tmp18_ = structure;
-				gst_structure_get_enum (_tmp18_, "image-type", GST_TYPE_TAG_IMAGE_TYPE, &_tmp19_);
-				image_type = _tmp19_;
-				_tmp20_ = image_type;
-				switch (_tmp20_) {
-					case GST_TAG_IMAGE_TYPE_UNDEFINED:
-					case GST_TAG_IMAGE_TYPE_FRONT_COVER:
-					{
-						RygelMediaArtStore* _tmp21_ = NULL;
-						RygelMediaArtStore* store;
-						RygelMediaArtStore* _tmp22_;
-						RygelMediaExportMusicItem* _tmp23_;
-						GFile* _tmp24_ = NULL;
-						GFile* thumb;
-						_tmp21_ = rygel_media_art_store_get_default ();
-						store = _tmp21_;
-						_tmp22_ = store;
-						_tmp23_ = item;
-						_tmp24_ = rygel_media_art_store_get_media_art_file (_tmp22_, "album", (RygelMusicItem*) _tmp23_, TRUE);
-						thumb = _tmp24_;
-						{
-							RygelMediaExportJPEGWriter* _tmp25_;
-							RygelMediaExportJPEGWriter* writer;
-							RygelMediaExportJPEGWriter* _tmp26_;
-							GstBuffer* _tmp27_;
-							GFile* _tmp28_;
-							_tmp25_ = rygel_media_export_jpeg_writer_new (&_inner_error_);
-							writer = _tmp25_;
-							if (_inner_error_ != NULL) {
-								goto __catch59_g_error;
-							}
-							_tmp26_ = writer;
-							_tmp27_ = buffer;
-							_tmp28_ = thumb;
-							rygel_media_export_jpeg_writer_write (_tmp26_, _tmp27_, _tmp28_);
-							g_object_unref (writer);
-						}
-						goto __finally59;
-						__catch59_g_error:
-						{
-							GError* _error_ = NULL;
-							_error_ = _inner_error_;
-							_inner_error_ = NULL;
-							g_error_free (_error_);
-						}
-						__finally59:
-						if (_inner_error_ != NULL) {
-							g_object_unref (thumb);
-							g_object_unref (store);
-							_gst_structure_free0 (structure);
-							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 NULL;
-						}
-						g_object_unref (thumb);
-						g_object_unref (store);
-						break;
-					}
-					default:
-					{
-						break;
-					}
-				}
-				_gst_structure_free0 (structure);
-			}
-		}
-		_tmp29_ = dlna_info;
-		_tmp30_ = gupnp_dlna_information_get_info (_tmp29_);
-		_tmp31_ = _tmp30_;
-		_tmp32_ = gst_discoverer_info_get_tags (_tmp31_);
-		gst_tag_list_get_string (_tmp32_, GST_TAG_ARTIST, &_tmp33_);
-		g_free (artist);
-		artist = _tmp33_;
-		_tmp34_ = item;
-		_tmp35_ = artist;
-		rygel_music_item_set_artist ((RygelMusicItem*) _tmp34_, _tmp35_);
-		_tmp36_ = dlna_info;
-		_tmp37_ = gupnp_dlna_information_get_info (_tmp36_);
-		_tmp38_ = _tmp37_;
-		_tmp39_ = gst_discoverer_info_get_tags (_tmp38_);
-		gst_tag_list_get_string (_tmp39_, GST_TAG_ALBUM, &_tmp40_);
-		g_free (album);
-		album = _tmp40_;
-		_tmp41_ = item;
-		_tmp42_ = album;
-		rygel_music_item_set_album ((RygelMusicItem*) _tmp41_, _tmp42_);
-		_tmp43_ = dlna_info;
-		_tmp44_ = gupnp_dlna_information_get_info (_tmp43_);
-		_tmp45_ = _tmp44_;
-		_tmp46_ = gst_discoverer_info_get_tags (_tmp45_);
-		gst_tag_list_get_string (_tmp46_, GST_TAG_GENRE, &_tmp47_);
-		g_free (genre);
-		genre = _tmp47_;
-		_tmp48_ = item;
-		_tmp49_ = genre;
-		rygel_music_item_set_genre ((RygelMusicItem*) _tmp48_, _tmp49_);
-		_tmp50_ = dlna_info;
-		_tmp51_ = gupnp_dlna_information_get_info (_tmp50_);
-		_tmp52_ = _tmp51_;
-		_tmp53_ = gst_discoverer_info_get_tags (_tmp52_);
-		gst_tag_list_get_uint (_tmp53_, GST_TAG_ALBUM_VOLUME_NUMBER, &_tmp54_);
-		tmp = _tmp54_;
-		_tmp55_ = item;
-		_tmp56_ = tmp;
-		_tmp55_->disc = (gint) _tmp56_;
-		_tmp57_ = dlna_info;
-		_tmp58_ = gupnp_dlna_information_get_info (_tmp57_);
-		_tmp59_ = _tmp58_;
-		_tmp60_ = gst_discoverer_info_get_tags (_tmp59_);
-		gst_tag_list_get_uint (_tmp60_, GST_TAG_TRACK_NUMBER, &_tmp61_);
-		tmp = _tmp61_;
-		_tmp62_ = item;
-		_tmp63_ = tmp;
-		rygel_music_item_set_track_number ((RygelMusicItem*) _tmp62_, (gint) _tmp63_);
-		g_free (genre);
-		g_free (album);
-		g_free (artist);
-	}
-	_tmp64_ = item;
-	_tmp65_ = g_object_ref ((RygelMediaItem*) _tmp64_);
-	result = _tmp65_;
-	return result;
+RygelMediaItem *rygel_media_export_item_factory_fill_music_item (RygelMediaExportMusicItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GstDiscovererAudioInfo *audio_info, GFileInfo *file_info) {
+  RygelMediaItem *result = NULL;
+  RygelMediaExportMusicItem *_tmp0_;
+  GUPnPDLNAInformation *_tmp1_;
+  GstDiscovererAudioInfo *_tmp2_;
+  RygelMediaExportMusicItem *_tmp3_;
+  GFile *_tmp4_;
+  GUPnPDLNAInformation *_tmp5_;
+  GFileInfo *_tmp6_;
+  GstDiscovererAudioInfo *_tmp7_;
+  RygelMediaExportMusicItem *_tmp64_;
+  RygelMediaItem *_tmp65_;
+  GError  *_inner_error_ = NULL;
+  g_return_val_if_fail (item, NULL);
+  g_return_val_if_fail (file, NULL);
+  g_return_val_if_fail (dlna_info, NULL);
+  g_return_val_if_fail (file_info, NULL);
+  _tmp0_ = item;
+  _tmp1_ = dlna_info;
+  _tmp2_ = audio_info;
+  rygel_media_export_item_factory_fill_audio_item (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, RYGEL_TYPE_AUDIO_ITEM) ? ((RygelAudioItem*) _tmp0_) : NULL, _tmp1_, _tmp2_);
+  _tmp3_ = item;
+  _tmp4_ = file;
+  _tmp5_ = dlna_info;
+  _tmp6_ = file_info;
+  rygel_media_export_item_factory_fill_media_item ((RygelMediaItem*) _tmp3_, _tmp4_, _tmp5_, _tmp6_);
+  _tmp7_ = audio_info;
+  if (_tmp7_) {
+    GstDiscovererAudioInfo *_tmp8_;
+    const GstTagList *_tmp9_ = NULL;
+    gchar *artist = NULL;
+    GUPnPDLNAInformation *_tmp29_;
+    const GstDiscovererInfo *_tmp30_;
+    const GstDiscovererInfo *_tmp31_;
+    const GstTagList *_tmp32_ = NULL;
+    gchar *_tmp33_ = NULL;
+    RygelMediaExportMusicItem *_tmp34_;
+    const gchar *_tmp35_;
+    gchar *album = NULL;
+    GUPnPDLNAInformation *_tmp36_;
+    const GstDiscovererInfo *_tmp37_;
+    const GstDiscovererInfo *_tmp38_;
+    const GstTagList *_tmp39_ = NULL;
+    gchar *_tmp40_ = NULL;
+    RygelMediaExportMusicItem *_tmp41_;
+    const gchar *_tmp42_;
+    gchar *genre = NULL;
+    GUPnPDLNAInformation *_tmp43_;
+    const GstDiscovererInfo *_tmp44_;
+    const GstDiscovererInfo *_tmp45_;
+    const GstTagList *_tmp46_ = NULL;
+    gchar *_tmp47_ = NULL;
+    RygelMediaExportMusicItem *_tmp48_;
+    const gchar *_tmp49_;
+    guint tmp = 0U;
+    GUPnPDLNAInformation *_tmp50_;
+    const GstDiscovererInfo *_tmp51_;
+    const GstDiscovererInfo *_tmp52_;
+    const GstTagList *_tmp53_ = NULL;
+    guint _tmp54_ = 0U;
+    RygelMediaExportMusicItem *_tmp55_;
+    guint _tmp56_;
+    GUPnPDLNAInformation *_tmp57_;
+    const GstDiscovererInfo *_tmp58_;
+    const GstDiscovererInfo *_tmp59_;
+    const GstTagList *_tmp60_ = NULL;
+    guint _tmp61_ = 0U;
+    RygelMediaExportMusicItem *_tmp62_;
+    guint _tmp63_;
+    _tmp8_ = audio_info;
+    _tmp9_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp8_);
+    if (_tmp9_) {
+      GstBuffer *buffer = NULL;
+      GstDiscovererAudioInfo *_tmp10_;
+      const GstTagList *_tmp11_ = NULL;
+      GstBuffer *_tmp12_ = NULL;
+      GstBuffer *_tmp13_;
+      _tmp10_ = audio_info;
+      _tmp11_ = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) _tmp10_);
+      gst_tag_list_get_buffer (_tmp11_, GST_TAG_IMAGE, &_tmp12_);
+      buffer = _tmp12_;
+      _tmp13_ = buffer;
+      if (_tmp13_) {
+        GstBuffer *_tmp14_;
+        GstCaps *_tmp15_;
+        const GstStructure *_tmp16_ = NULL;
+        GstStructure *_tmp17_;
+        GstStructure *structure;
+        gint image_type = 0;
+        const GstStructure *_tmp18_;
+        gint _tmp19_ = 0;
+        gint _tmp20_;
+        _tmp14_ = buffer;
+        _tmp15_ = _tmp14_->caps;
+        _tmp16_ = gst_caps_get_structure (_tmp15_, (guint) 0);
+        _tmp17_ = _gst_structure_copy0 (_tmp16_);
+        structure = _tmp17_;
+        _tmp18_ = structure;
+        gst_structure_get_enum (_tmp18_, "image-type", GST_TYPE_TAG_IMAGE_TYPE, &_tmp19_);
+        image_type = _tmp19_;
+        _tmp20_ = image_type;
+        switch (_tmp20_) {
+          case GST_TAG_IMAGE_TYPE_UNDEFINED:
+          case GST_TAG_IMAGE_TYPE_FRONT_COVER:
+          {
+            RygelMediaArtStore *_tmp21_ = NULL;
+            RygelMediaArtStore *store;
+            RygelMediaArtStore *_tmp22_;
+            RygelMediaExportMusicItem *_tmp23_;
+            GFile *_tmp24_ = NULL;
+            GFile *thumb;
+            _tmp21_ = rygel_media_art_store_get_default ();
+            store = _tmp21_;
+            _tmp22_ = store;
+            _tmp23_ = item;
+            _tmp24_ = rygel_media_art_store_get_media_art_file (_tmp22_, "album", (RygelMusicItem*) _tmp23_, TRUE);
+            thumb = _tmp24_;
+            {
+              RygelMediaExportJPEGWriter *_tmp25_;
+              RygelMediaExportJPEGWriter *writer;
+              RygelMediaExportJPEGWriter *_tmp26_;
+              GstBuffer *_tmp27_;
+              GFile *_tmp28_;
+              _tmp25_ = rygel_media_export_jpeg_writer_new (&_inner_error_);
+              writer = _tmp25_;
+              if (_inner_error_) {
+                goto __catch59_g_error;
+              }
+              _tmp26_ = writer;
+              _tmp27_ = buffer;
+              _tmp28_ = thumb;
+              rygel_media_export_jpeg_writer_write (_tmp26_, _tmp27_, _tmp28_);
+              g_object_unref (writer);
+            }
+            goto __finally59;
+            __catch59_g_error:
+            {
+              GError *_error_ = NULL;
+              _error_ = _inner_error_;
+              _inner_error_ = NULL;
+              g_error_free (_error_);
+            }
+            __finally59:
+            if (_inner_error_) {
+              g_object_unref (thumb);
+              g_object_unref (store);
+              _gst_structure_free0 (structure);
+              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 NULL;
+            }
+            g_object_unref (thumb);
+            g_object_unref (store);
+            break;
+          }
+          default:
+          {
+            break;
+          }
+        }
+        _gst_structure_free0 (structure);
+      }
+    }
+    _tmp29_ = dlna_info;
+    _tmp30_ = gupnp_dlna_information_get_info (_tmp29_);
+    _tmp31_ = _tmp30_;
+    _tmp32_ = gst_discoverer_info_get_tags (_tmp31_);
+    gst_tag_list_get_string (_tmp32_, GST_TAG_ARTIST, &_tmp33_);
+    g_free (artist);
+    artist = _tmp33_;
+    _tmp34_ = item;
+    _tmp35_ = artist;
+    rygel_music_item_set_artist ((RygelMusicItem*) _tmp34_, _tmp35_);
+    _tmp36_ = dlna_info;
+    _tmp37_ = gupnp_dlna_information_get_info (_tmp36_);
+    _tmp38_ = _tmp37_;
+    _tmp39_ = gst_discoverer_info_get_tags (_tmp38_);
+    gst_tag_list_get_string (_tmp39_, GST_TAG_ALBUM, &_tmp40_);
+    g_free (album);
+    album = _tmp40_;
+    _tmp41_ = item;
+    _tmp42_ = album;
+    rygel_music_item_set_album ((RygelMusicItem*) _tmp41_, _tmp42_);
+    _tmp43_ = dlna_info;
+    _tmp44_ = gupnp_dlna_information_get_info (_tmp43_);
+    _tmp45_ = _tmp44_;
+    _tmp46_ = gst_discoverer_info_get_tags (_tmp45_);
+    gst_tag_list_get_string (_tmp46_, GST_TAG_GENRE, &_tmp47_);
+    g_free (genre);
+    genre = _tmp47_;
+    _tmp48_ = item;
+    _tmp49_ = genre;
+    rygel_music_item_set_genre ((RygelMusicItem*) _tmp48_, _tmp49_);
+    _tmp50_ = dlna_info;
+    _tmp51_ = gupnp_dlna_information_get_info (_tmp50_);
+    _tmp52_ = _tmp51_;
+    _tmp53_ = gst_discoverer_info_get_tags (_tmp52_);
+    gst_tag_list_get_uint (_tmp53_, GST_TAG_ALBUM_VOLUME_NUMBER, &_tmp54_);
+    tmp = _tmp54_;
+    _tmp55_ = item;
+    _tmp56_ = tmp;
+    _tmp55_->disc = (gint) _tmp56_;
+    _tmp57_ = dlna_info;
+    _tmp58_ = gupnp_dlna_information_get_info (_tmp57_);
+    _tmp59_ = _tmp58_;
+    _tmp60_ = gst_discoverer_info_get_tags (_tmp59_);
+    gst_tag_list_get_uint (_tmp60_, GST_TAG_TRACK_NUMBER, &_tmp61_);
+    tmp = _tmp61_;
+    _tmp62_ = item;
+    _tmp63_ = tmp;
+    rygel_music_item_set_track_number ((RygelMusicItem*) _tmp62_, (gint) _tmp63_);
+    g_free (genre);
+    g_free (album);
+    g_free (artist);
+  }
+  _tmp64_ = item;
+  _tmp65_ = g_object_ref ((RygelMediaItem*) _tmp64_);
+  result = _tmp65_;
+  return result;
 }
 
 
-void rygel_media_export_item_factory_fill_media_item (RygelMediaItem* item, GFile* file, GUPnPDLNAInformation* dlna_info, GFileInfo* file_info) {
-	gchar* title;
-	gboolean _tmp0_ = FALSE;
-	GUPnPDLNAInformation* _tmp1_;
-	const GstDiscovererInfo* _tmp2_;
-	const GstDiscovererInfo* _tmp3_;
-	const GstTagList* _tmp4_ = NULL;
-	gboolean _tmp11_;
-	RygelMediaItem* _tmp15_;
-	const gchar* _tmp16_;
-	GUPnPDLNAInformation* _tmp17_;
-	const GstDiscovererInfo* _tmp18_;
-	const GstDiscovererInfo* _tmp19_;
-	const GstTagList* _tmp20_ = NULL;
-	GFileInfo* _tmp32_;
-	guint64 _tmp33_ = 0ULL;
-	guint64 mtime;
-	RygelMediaItem* _tmp34_;
-	const gchar* _tmp35_;
-	const gchar* _tmp36_;
-	RygelMediaItem* _tmp42_;
-	GFileInfo* _tmp43_;
-	gint64 _tmp44_ = 0LL;
-	RygelMediaItem* _tmp45_;
-	guint64 _tmp46_;
-	GUPnPDLNAInformation* _tmp47_;
-	const gchar* _tmp48_;
-	const gchar* _tmp49_;
-	RygelMediaItem* _tmp63_;
-	GFile* _tmp64_;
-	gchar* _tmp65_ = NULL;
-	gchar* _tmp66_;
-	g_return_if_fail (item != NULL);
-	g_return_if_fail (file != NULL);
-	g_return_if_fail (dlna_info != NULL);
-	g_return_if_fail (file_info != NULL);
-	title = NULL;
-	_tmp1_ = dlna_info;
-	_tmp2_ = gupnp_dlna_information_get_info (_tmp1_);
-	_tmp3_ = _tmp2_;
-	_tmp4_ = gst_discoverer_info_get_tags (_tmp3_);
-	if (_tmp4_ == NULL) {
-		_tmp0_ = TRUE;
-	} else {
-		GUPnPDLNAInformation* _tmp5_;
-		const GstDiscovererInfo* _tmp6_;
-		const GstDiscovererInfo* _tmp7_;
-		const GstTagList* _tmp8_ = NULL;
-		gchar* _tmp9_ = NULL;
-		gboolean _tmp10_ = FALSE;
-		_tmp5_ = dlna_info;
-		_tmp6_ = gupnp_dlna_information_get_info (_tmp5_);
-		_tmp7_ = _tmp6_;
-		_tmp8_ = gst_discoverer_info_get_tags (_tmp7_);
-		_tmp10_ = gst_tag_list_get_string (_tmp8_, GST_TAG_TITLE, &_tmp9_);
-		g_free (title);
-		title = _tmp9_;
-		_tmp0_ = !_tmp10_;
-	}
-	_tmp11_ = _tmp0_;
-	if (_tmp11_) {
-		GFileInfo* _tmp12_;
-		const gchar* _tmp13_ = NULL;
-		gchar* _tmp14_;
-		_tmp12_ = file_info;
-		_tmp13_ = g_file_info_get_display_name (_tmp12_);
-		_tmp14_ = g_strdup (_tmp13_);
-		g_free (title);
-		title = _tmp14_;
-	}
-	_tmp15_ = item;
-	_tmp16_ = title;
-	rygel_media_object_set_title ((RygelMediaObject*) _tmp15_, _tmp16_);
-	_tmp17_ = dlna_info;
-	_tmp18_ = gupnp_dlna_information_get_info (_tmp17_);
-	_tmp19_ = _tmp18_;
-	_tmp20_ = gst_discoverer_info_get_tags (_tmp19_);
-	if (_tmp20_ != NULL) {
-		GDate* date = NULL;
-		GUPnPDLNAInformation* _tmp21_;
-		const GstDiscovererInfo* _tmp22_;
-		const GstDiscovererInfo* _tmp23_;
-		const GstTagList* _tmp24_ = NULL;
-		GDate* _tmp25_ = NULL;
-		gboolean _tmp26_ = FALSE;
-		_tmp21_ = dlna_info;
-		_tmp22_ = gupnp_dlna_information_get_info (_tmp21_);
-		_tmp23_ = _tmp22_;
-		_tmp24_ = gst_discoverer_info_get_tags (_tmp23_);
-		_tmp26_ = gst_tag_list_get_date (_tmp24_, GST_TAG_DATE, &_tmp25_);
-		g_free (date);
-		date = _tmp25_;
-		if (_tmp26_) {
-			gchar* _tmp27_ = NULL;
-			gchar* datestr;
-			gint datestr_length1;
-			GDate* _tmp28_;
-			gchar* _tmp29_;
-			gint _tmp29__length1;
-			RygelMediaItem* _tmp30_;
-			gchar* _tmp31_;
-			_tmp27_ = g_new0 (gchar, 30);
-			datestr = _tmp27_;
-			datestr_length1 = 30;
-			_tmp28_ = date;
-			_tmp29_ = datestr;
-			_tmp29__length1 = datestr_length1;
-			g_date_strftime (_tmp29_, _tmp29__length1, "%F", _tmp28_);
-			_tmp30_ = item;
-			_tmp31_ = datestr;
-			rygel_media_item_set_date (_tmp30_, (const gchar*) _tmp31_);
-			datestr = (g_free (datestr), NULL);
-		}
-		g_free (date);
-	}
-	_tmp32_ = file_info;
-	_tmp33_ = g_file_info_get_attribute_uint64 (_tmp32_, G_FILE_ATTRIBUTE_TIME_MODIFIED);
-	mtime = _tmp33_;
-	_tmp34_ = item;
-	_tmp35_ = rygel_media_item_get_date (_tmp34_);
-	_tmp36_ = _tmp35_;
-	if (_tmp36_ == NULL) {
-		guint64 _tmp37_;
-		GTimeVal _tmp38_ = {0};
-		GTimeVal tv;
-		RygelMediaItem* _tmp39_;
-		gchar* _tmp40_ = NULL;
-		gchar* _tmp41_;
-		_tmp37_ = mtime;
-		_tmp38_.tv_sec = (glong) _tmp37_;
-		_tmp38_.tv_usec = (glong) 0;
-		tv = _tmp38_;
-		_tmp39_ = item;
-		_tmp40_ = g_time_val_to_iso8601 (&tv);
-		_tmp41_ = _tmp40_;
-		rygel_media_item_set_date (_tmp39_, _tmp41_);
-		g_free (_tmp41_);
-	}
-	_tmp42_ = item;
-	_tmp43_ = file_info;
-	_tmp44_ = g_file_info_get_size (_tmp43_);
-	rygel_media_item_set_size (_tmp42_, (gint64) _tmp44_);
-	_tmp45_ = item;
-	_tmp46_ = mtime;
-	rygel_media_object_set_modified ((RygelMediaObject*) _tmp45_, (guint64) ((gint64) _tmp46_));
-	_tmp47_ = dlna_info;
-	_tmp48_ = gupnp_dlna_information_get_name (_tmp47_);
-	_tmp49_ = _tmp48_;
-	if (_tmp49_ != NULL) {
-		RygelMediaItem* _tmp50_;
-		GUPnPDLNAInformation* _tmp51_;
-		const gchar* _tmp52_;
-		const gchar* _tmp53_;
-		RygelMediaItem* _tmp54_;
-		GUPnPDLNAInformation* _tmp55_;
-		const gchar* _tmp56_;
-		const gchar* _tmp57_;
-		_tmp50_ = item;
-		_tmp51_ = dlna_info;
-		_tmp52_ = gupnp_dlna_information_get_name (_tmp51_);
-		_tmp53_ = _tmp52_;
-		rygel_media_item_set_dlna_profile (_tmp50_, _tmp53_);
-		_tmp54_ = item;
-		_tmp55_ = dlna_info;
-		_tmp56_ = gupnp_dlna_information_get_mime (_tmp55_);
-		_tmp57_ = _tmp56_;
-		rygel_media_item_set_mime_type (_tmp54_, _tmp57_);
-	} else {
-		RygelMediaItem* _tmp58_;
-		GFileInfo* _tmp59_;
-		const gchar* _tmp60_ = NULL;
-		gchar* _tmp61_ = NULL;
-		gchar* _tmp62_;
-		_tmp58_ = item;
-		_tmp59_ = file_info;
-		_tmp60_ = g_file_info_get_content_type (_tmp59_);
-		_tmp61_ = g_content_type_get_mime_type (_tmp60_);
-		_tmp62_ = _tmp61_;
-		rygel_media_item_set_mime_type (_tmp58_, _tmp62_);
-		g_free (_tmp62_);
-	}
-	_tmp63_ = item;
-	_tmp64_ = file;
-	_tmp65_ = g_file_get_uri (_tmp64_);
-	_tmp66_ = _tmp65_;
-	rygel_media_item_add_uri (_tmp63_, _tmp66_);
-	g_free (_tmp66_);
-	g_free (title);
+void rygel_media_export_item_factory_fill_media_item (RygelMediaItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GFileInfo *file_info) {
+  gchar *title;
+  gboolean _tmp0_ = FALSE;
+  GUPnPDLNAInformation *_tmp1_;
+  const GstDiscovererInfo *_tmp2_;
+  const GstDiscovererInfo *_tmp3_;
+  const GstTagList *_tmp4_ = NULL;
+  gboolean _tmp11_;
+  RygelMediaItem *_tmp15_;
+  const gchar *_tmp16_;
+  GUPnPDLNAInformation *_tmp17_;
+  const GstDiscovererInfo *_tmp18_;
+  const GstDiscovererInfo *_tmp19_;
+  const GstTagList *_tmp20_ = NULL;
+  GFileInfo *_tmp32_;
+  guint64 _tmp33_ = 0ULL;
+  guint64 mtime;
+  RygelMediaItem *_tmp34_;
+  const gchar *_tmp35_;
+  const gchar *_tmp36_;
+  RygelMediaItem *_tmp42_;
+  GFileInfo *_tmp43_;
+  gint64 _tmp44_ = 0LL;
+  RygelMediaItem *_tmp45_;
+  guint64 _tmp46_;
+  GUPnPDLNAInformation *_tmp47_;
+  const gchar *_tmp48_;
+  const gchar *_tmp49_;
+  RygelMediaItem *_tmp63_;
+  GFile *_tmp64_;
+  gchar *_tmp65_ = NULL;
+  gchar *_tmp66_;
+  g_return_if_fail (item);
+  g_return_if_fail (file);
+  g_return_if_fail (dlna_info);
+  g_return_if_fail (file_info);
+  title = NULL;
+  _tmp1_ = dlna_info;
+  _tmp2_ = gupnp_dlna_information_get_info (_tmp1_);
+  _tmp3_ = _tmp2_;
+  _tmp4_ = gst_discoverer_info_get_tags (_tmp3_);
+  if (_tmp4_ == NULL) {
+    _tmp0_ = TRUE;
+  } else {
+    GUPnPDLNAInformation *_tmp5_;
+    const GstDiscovererInfo *_tmp6_;
+    const GstDiscovererInfo *_tmp7_;
+    const GstTagList *_tmp8_ = NULL;
+    gchar *_tmp9_ = NULL;
+    gboolean _tmp10_ = FALSE;
+    _tmp5_ = dlna_info;
+    _tmp6_ = gupnp_dlna_information_get_info (_tmp5_);
+    _tmp7_ = _tmp6_;
+    _tmp8_ = gst_discoverer_info_get_tags (_tmp7_);
+    _tmp10_ = gst_tag_list_get_string (_tmp8_, GST_TAG_TITLE, &_tmp9_);
+    g_free (title);
+    title = _tmp9_;
+    _tmp0_ = !_tmp10_;
+  }
+  _tmp11_ = _tmp0_;
+  if (_tmp11_) {
+    GFileInfo *_tmp12_;
+    const gchar *_tmp13_ = NULL;
+    gchar *_tmp14_;
+    _tmp12_ = file_info;
+    _tmp13_ = g_file_info_get_display_name (_tmp12_);
+    _tmp14_ = g_strdup (_tmp13_);
+    g_free (title);
+    title = _tmp14_;
+  }
+  _tmp15_ = item;
+  _tmp16_ = title;
+  rygel_media_object_set_title ((RygelMediaObject*) _tmp15_, _tmp16_);
+  _tmp17_ = dlna_info;
+  _tmp18_ = gupnp_dlna_information_get_info (_tmp17_);
+  _tmp19_ = _tmp18_;
+  _tmp20_ = gst_discoverer_info_get_tags (_tmp19_);
+  if (_tmp20_) {
+    GDate *date = NULL;
+    GUPnPDLNAInformation *_tmp21_;
+    const GstDiscovererInfo *_tmp22_;
+    const GstDiscovererInfo *_tmp23_;
+    const GstTagList *_tmp24_ = NULL;
+    GDate *_tmp25_ = NULL;
+    gboolean _tmp26_ = FALSE;
+    _tmp21_ = dlna_info;
+    _tmp22_ = gupnp_dlna_information_get_info (_tmp21_);
+    _tmp23_ = _tmp22_;
+    _tmp24_ = gst_discoverer_info_get_tags (_tmp23_);
+    _tmp26_ = gst_tag_list_get_date (_tmp24_, GST_TAG_DATE, &_tmp25_);
+    g_free (date);
+    date = _tmp25_;
+    if (_tmp26_) {
+      gchar *_tmp27_ = NULL;
+      gchar *datestr;
+      gint datestr_length1;
+      GDate *_tmp28_;
+      gchar *_tmp29_;
+      gint _tmp29__length1;
+      RygelMediaItem *_tmp30_;
+      gchar *_tmp31_;
+      _tmp27_ = g_new0 (gchar, 30);
+      datestr = _tmp27_;
+      datestr_length1 = 30;
+      _tmp28_ = date;
+      _tmp29_ = datestr;
+      _tmp29__length1 = datestr_length1;
+      g_date_strftime (_tmp29_, _tmp29__length1, "%F", _tmp28_);
+      _tmp30_ = item;
+      _tmp31_ = datestr;
+      rygel_media_item_set_date (_tmp30_, (const gchar*) _tmp31_);
+      datestr = (g_free (datestr), NULL);
+    }
+    g_free (date);
+  }
+  _tmp32_ = file_info;
+  _tmp33_ = g_file_info_get_attribute_uint64 (_tmp32_, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+  mtime = _tmp33_;
+  _tmp34_ = item;
+  _tmp35_ = rygel_media_item_get_date (_tmp34_);
+  _tmp36_ = _tmp35_;
+  if (_tmp36_ == NULL) {
+    guint64 _tmp37_;
+    GTimeVal _tmp38_ = {0};
+    GTimeVal tv;
+    RygelMediaItem *_tmp39_;
+    gchar *_tmp40_ = NULL;
+    gchar *_tmp41_;
+    _tmp37_ = mtime;
+    _tmp38_.tv_sec = (glong) _tmp37_;
+    _tmp38_.tv_usec = (glong) 0;
+    tv = _tmp38_;
+    _tmp39_ = item;
+    _tmp40_ = g_time_val_to_iso8601 (&tv);
+    _tmp41_ = _tmp40_;
+    rygel_media_item_set_date (_tmp39_, _tmp41_);
+    g_free (_tmp41_);
+  }
+  _tmp42_ = item;
+  _tmp43_ = file_info;
+  _tmp44_ = g_file_info_get_size (_tmp43_);
+  rygel_media_item_set_size (_tmp42_, (gint64) _tmp44_);
+  _tmp45_ = item;
+  _tmp46_ = mtime;
+  rygel_media_object_set_modified ((RygelMediaObject*) _tmp45_, (guint64) ((gint64) _tmp46_));
+  _tmp47_ = dlna_info;
+  _tmp48_ = gupnp_dlna_information_get_name (_tmp47_);
+  _tmp49_ = _tmp48_;
+  if (_tmp49_) {
+    RygelMediaItem *_tmp50_;
+    GUPnPDLNAInformation *_tmp51_;
+    const gchar *_tmp52_;
+    const gchar *_tmp53_;
+    RygelMediaItem *_tmp54_;
+    GUPnPDLNAInformation *_tmp55_;
+    const gchar *_tmp56_;
+    const gchar *_tmp57_;
+    _tmp50_ = item;
+    _tmp51_ = dlna_info;
+    _tmp52_ = gupnp_dlna_information_get_name (_tmp51_);
+    _tmp53_ = _tmp52_;
+    rygel_media_item_set_dlna_profile (_tmp50_, _tmp53_);
+    _tmp54_ = item;
+    _tmp55_ = dlna_info;
+    _tmp56_ = gupnp_dlna_information_get_mime (_tmp55_);
+    _tmp57_ = _tmp56_;
+    rygel_media_item_set_mime_type (_tmp54_, _tmp57_);
+  } else {
+    RygelMediaItem *_tmp58_;
+    GFileInfo *_tmp59_;
+    const gchar *_tmp60_ = NULL;
+    gchar *_tmp61_ = NULL;
+    gchar *_tmp62_;
+    _tmp58_ = item;
+    _tmp59_ = file_info;
+    _tmp60_ = g_file_info_get_content_type (_tmp59_);
+    _tmp61_ = g_content_type_get_mime_type (_tmp60_);
+    _tmp62_ = _tmp61_;
+    rygel_media_item_set_mime_type (_tmp58_, _tmp62_);
+    g_free (_tmp62_);
+  }
+  _tmp63_ = item;
+  _tmp64_ = file;
+  _tmp65_ = g_file_get_uri (_tmp64_);
+  _tmp66_ = _tmp65_;
+  rygel_media_item_add_uri (_tmp63_, _tmp66_);
+  g_free (_tmp66_);
+  g_free (title);
 }
 
 



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