[rygel-gst-0-10-plugins] Whitespace and no-C99 fixes.



commit 2a946dbed1d2c6d93cba776c0aa623d6d3267922
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Mon Feb 11 13:55:08 2013 +0100

    Whitespace and no-C99 fixes.

 src/media-export/rygel-media-export-item-factory.c |  351 ++++++++++++--------
 1 files changed, 221 insertions(+), 130 deletions(-)
---
diff --git a/src/media-export/rygel-media-export-item-factory.c b/src/media-export/rygel-media-export-item-factory.c
index 5a7a9e5..9309875 100644
--- a/src/media-export/rygel-media-export-item-factory.c
+++ b/src/media-export/rygel-media-export-item-factory.c
@@ -27,11 +27,15 @@
 #include "rygel-media-export-item-factory.h"
 #include "rygel-media-export-jpeg-writer.h"
 
-RygelMediaItem*
-rygel_media_export_item_factory_create_simple (RygelMediaContainer *parent, GFile *file, GFileInfo *info) {
-  RygelMediaItem *item = NULL;
-  gchar *title = NULL;
-  gchar *mime = NULL;
+RygelMediaItem *
+rygel_media_export_item_factory_create_simple (RygelMediaContainer *parent,
+                                               GFile               *file,
+                                               GFileInfo           *info) {
+  RygelMediaItem *item;
+  gchar *title;
+  gchar *mime;
+  gchar *id;
+  gchar *uri;
 
   g_return_val_if_fail (RYGEL_IS_MEDIA_CONTAINER (parent), NULL);
   g_return_val_if_fail (G_IS_FILE (file), NULL);
@@ -55,26 +59,27 @@ rygel_media_export_item_factory_create_simple (RygelMediaContainer *parent, GFil
   rygel_media_item_set_mime_type (item, mime);
   g_free (mime);
 
-  rygel_media_item_set_size (item,
-    (gint64) g_file_info_get_size (info));
+  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));
+                                   g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED));
 
-  gchar *uri = g_file_get_uri (file);
+  uri = g_file_get_uri (file);
   rygel_media_item_add_uri (item, uri);
   g_free (uri);
 
   return 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;
+RygelMediaItem *
+rygel_media_export_item_factory_create_from_info (RygelMediaContainer  *parent,
+                                                  GFile                *file,
+                                                  GUPnPDLNAInformation *dlna_info,
+                                                  GFileInfo            *file_info) {
+  RygelMediaItem *result;
+  gchar *id;
+  const GstDiscovererInfo *discoverer_info;
+  GList *audio_streams;
+  GList *video_streams;
 
   g_return_val_if_fail (RYGEL_IS_MEDIA_CONTAINER (parent), NULL);
   g_return_val_if_fail (G_IS_FILE (file), NULL);
@@ -87,34 +92,55 @@ rygel_media_export_item_factory_create_from_info (RygelMediaContainer *parent, G
   audio_streams = gst_discoverer_info_get_audio_streams ((GstDiscovererInfo *) discoverer_info);
   video_streams = gst_discoverer_info_get_video_streams ((GstDiscovererInfo *) discoverer_info);
 
-  if( !audio_streams && !video_streams) {
+  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_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)) {
+             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);
+                                                                         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);
+                                                                         parent,
+                                                                         "",
+                                                                         RYGEL_VIDEO_ITEM_UPNP_CLASS);
+    GstDiscovererAudioInfo *audio_info;
 
-    GstDiscovererAudioInfo *audio_info = NULL;
-    if(audio_streams) {
+    if (audio_streams) {
       audio_info = (GstDiscovererAudioInfo*) audio_streams->data;
+    } else {
+      audio_info = NULL;
     }
 
-    result = rygel_media_export_item_factory_fill_video_item (item, file,
-      dlna_info, (GstDiscovererVideoInfo*) video_streams->data, audio_info, file_info);
+    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);
+                                                                         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;
   }
@@ -127,41 +153,55 @@ rygel_media_export_item_factory_create_from_info (RygelMediaContainer *parent, G
   return result;
 }
 
-
 void
-rygel_media_export_item_factory_fill_audio_item (RygelAudioItem *item, GUPnPDLNAInformation *dlna_info, GstDiscovererAudioInfo *audio_info) {
+rygel_media_export_item_factory_fill_audio_item (RygelAudioItem         *item,
+                                                 GUPnPDLNAInformation   *dlna_info,
+                                                 GstDiscovererAudioInfo *audio_info) {
+  const GstDiscovererInfo *info;
+  GstClockTime duration;
+  const GstTagList *tags;
+
   g_return_if_fail (RYGEL_IS_AUDIO_ITEM (item));
   g_return_if_fail (GUPNP_IS_DLNA_INFORMATION (dlna_info));
   g_return_if_fail (audio_info == NULL || GST_IS_DISCOVERER_AUDIO_INFO (audio_info));
 
-  const GstDiscovererInfo *info = gupnp_dlna_information_get_info (dlna_info);
-  GstClockTime duration = gst_discoverer_info_get_duration (info);
+  info = gupnp_dlna_information_get_info (dlna_info);
+  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)
+  if (!audio_info) {
     return;
+  }
 
-  const GstTagList *tags = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) audio_info);
+  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);
 
+    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));
+                                 (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));
+                                    (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) {
+  RygelVisualItem *visual_item;
+  RygelMediaItem *media_item;
+  gint color_depth;
 
-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 (RYGEL_MEDIA_EXPORT_IS_VIDEO_ITEM (item), NULL);
   g_return_val_if_fail (G_IS_FILE (file), NULL);
   g_return_val_if_fail (GUPNP_IS_DLNA_INFORMATION (dlna_info), NULL);
@@ -170,46 +210,73 @@ rygel_media_export_item_factory_fill_video_item (RygelMediaExportVideoItem *item
   g_return_val_if_fail (G_IS_FILE_INFO (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);
+  media_item = RYGEL_MEDIA_ITEM (item);
+  rygel_media_export_item_factory_fill_media_item (media_item, file, dlna_info, file_info);
+  visual_item = RYGEL_VISUAL_ITEM (item);
 
-  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));
+  rygel_visual_item_set_width (visual_item,
+                               (gint) gst_discoverer_video_info_get_width (video_info));
+  rygel_visual_item_set_height (visual_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 );
+  color_depth = gst_discoverer_video_info_get_depth (video_info);
+  rygel_visual_item_set_color_depth (visual_item,
+                                     ((color_depth == 0) ? -1 : color_depth));
 
-  return RYGEL_MEDIA_ITEM (item);
+  return media_item;
 }
 
+RygelMediaItem *
+rygel_media_export_item_factory_fill_photo_item (RygelMediaExportPhotoItem *item,
+                                                 GFile                     *file,
+                                                 GUPnPDLNAInformation      *dlna_info,
+                                                 GstDiscovererVideoInfo    *video_info,
+                                                 GFileInfo                 *file_info) {
+  RygelVisualItem *visual_item;
+  RygelMediaItem *media_item;
+  gint color_depth;
 
-RygelMediaItem*
-rygel_media_export_item_factory_fill_photo_item (RygelMediaExportPhotoItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GstDiscovererVideoInfo *video_info, GFileInfo *file_info) {
   g_return_val_if_fail (RYGEL_MEDIA_EXPORT_IS_PHOTO_ITEM (item), NULL);
   g_return_val_if_fail (G_IS_FILE (file), NULL);
   g_return_val_if_fail (GUPNP_IS_DLNA_INFORMATION (dlna_info), NULL);
   g_return_val_if_fail (GST_IS_DISCOVERER_VIDEO_INFO (video_info), NULL);
   g_return_val_if_fail (G_IS_FILE_INFO (file_info), NULL);
 
-  rygel_media_export_item_factory_fill_media_item (RYGEL_MEDIA_ITEM (item),
-    file, dlna_info, file_info);
+  media_item = RYGEL_MEDIA_ITEM (item);
+  rygel_media_export_item_factory_fill_media_item (media_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));
+  visual_item = RYGEL_VISUAL_ITEM (item);
+  rygel_visual_item_set_width (visual_item,
+                               (gint) gst_discoverer_video_info_get_width (video_info));
+  rygel_visual_item_set_height (visual_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 );
+  color_depth = gst_discoverer_video_info_get_depth (video_info);
+  rygel_visual_item_set_color_depth (visual_item,
+                                     ((color_depth == 0) ? -1 : color_depth));
 
-  return RYGEL_MEDIA_ITEM (item);
+  return media_item;
 }
 
-RygelMediaItem *rygel_media_export_item_factory_fill_music_item (RygelMediaExportMusicItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GstDiscovererAudioInfo *audio_info, GFileInfo *file_info) {
-  RygelMediaItem *result = RYGEL_MEDIA_ITEM (item);
+RygelMediaItem *
+rygel_media_export_item_factory_fill_music_item (RygelMediaExportMusicItem *item,
+                                                 GFile                     *file,
+                                                 GUPnPDLNAInformation      *dlna_info,
+                                                 GstDiscovererAudioInfo    *audio_info,
+                                                 GFileInfo                 *file_info) {
+  RygelMediaItem *media_item;
+  const GstTagList *tags;
+  gchar *artist;
+  gchar *album;
+  gchar *genre;
+  guint volume_number;
+  guint track_number;
+  GstBuffer *buffer;
+  GstStructure *structure;
+  gint image_type;
 
   g_return_val_if_fail (RYGEL_MEDIA_EXPORT_IS_MUSIC_ITEM (item), NULL);
   g_return_val_if_fail (G_IS_FILE (file), NULL);
@@ -217,148 +284,172 @@ RygelMediaItem *rygel_media_export_item_factory_fill_music_item (RygelMediaExpor
   g_return_val_if_fail (audio_info == NULL || GST_IS_DISCOVERER_AUDIO_INFO (audio_info), NULL);
   g_return_val_if_fail (G_IS_FILE_INFO (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);
-
-  if (!audio_info)
-    return result;
+  rygel_media_export_item_factory_fill_audio_item (RYGEL_AUDIO_ITEM (item),
+                                                   dlna_info,
+                                                   audio_info);
+  media_item = RYGEL_MEDIA_ITEM (item);
+  rygel_media_export_item_factory_fill_media_item (media_item,
+                                                   file,
+                                                   dlna_info,
+                                                   file_info);
+
+  if (!audio_info) {
+    return media_item;
+  }
 
-  const GstTagList *tags = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) audio_info);
-  if (!tags)
-    return result;
+  tags = gst_discoverer_stream_info_get_tags ((GstDiscovererStreamInfo*) audio_info);
+  if (!tags) {
+    return media_item;
+  }
 
-  gchar *artist = NULL;
+  artist = NULL;
   gst_tag_list_get_string (tags, GST_TAG_ARTIST, &artist);
   rygel_music_item_set_artist (RYGEL_MUSIC_ITEM (item), artist);
   g_free (artist);
 
-  gchar *album = NULL;
+  album = NULL;
   gst_tag_list_get_string (tags, GST_TAG_ALBUM, &album);
   rygel_music_item_set_album (RYGEL_MUSIC_ITEM (item), album);
   g_free (album);
 
-  gchar *genre = NULL;
+  genre = NULL;
   gst_tag_list_get_string (tags, GST_TAG_GENRE, &genre);
   rygel_music_item_set_genre (RYGEL_MUSIC_ITEM (item), genre);
   g_free (genre);
 
-  guint volume_number = 0U;
+  volume_number = 0U;
   gst_tag_list_get_uint (tags, GST_TAG_ALBUM_VOLUME_NUMBER, &volume_number);
   item->disc = volume_number;
 
-  guint track_number = 0U;
+  track_number = 0U;
   gst_tag_list_get_uint (tags, GST_TAG_TRACK_NUMBER, &track_number);
   rygel_music_item_set_track_number (RYGEL_MUSIC_ITEM (item), track_number);
 
   rygel_audio_item_set_sample_freq (RYGEL_AUDIO_ITEM (item),
-    (gint) gst_discoverer_audio_info_get_sample_rate ((GstDiscovererAudioInfo *) audio_info));
+                                    (gint) gst_discoverer_audio_info_get_sample_rate (audio_info));
 
-  GstBuffer* buffer = NULL;
-        gst_tag_list_get_buffer (tags, GST_TAG_IMAGE, &buffer);
-  if (!buffer || !buffer->caps)
-    return result;
+  buffer = NULL;
+  gst_tag_list_get_buffer (tags, GST_TAG_IMAGE, &buffer);
+  if (!buffer || !buffer->caps) {
+    return media_item;
+  }
 
-  GstStructure *structure = gst_caps_get_structure (buffer->caps,  0);
+  structure = gst_caps_get_structure (buffer->caps,  0);
   if (!structure)
-    return result;
+    return media_item;
 
-  gint image_type = 0;
-  gst_structure_get_enum (structure, "image-type",
-    GST_TYPE_TAG_IMAGE_TYPE, &image_type);
+  image_type = 0;
+  gst_structure_get_enum (structure,
+                          "image-type",
+                          GST_TYPE_TAG_IMAGE_TYPE,
+                          &image_type);
   switch (image_type) {
-    case GST_TAG_IMAGE_TYPE_UNDEFINED:
-    case GST_TAG_IMAGE_TYPE_FRONT_COVER:
-          {
-                  RygelMediaArtStore *store = rygel_media_art_store_get_default ();
-                  GFile* thumb = rygel_media_art_store_get_media_art_file (store,
-                    "album", RYGEL_MUSIC_ITEM (item), TRUE);
-
-      RygelMediaExportJPEGWriter *writer =
-        rygel_media_export_jpeg_writer_new (NULL);
-      if (writer) {
-        rygel_media_export_jpeg_writer_write (writer, buffer, thumb);
-        g_object_unref (writer);
-      }
-
-      g_object_unref (thumb);
-      g_object_unref (store); /* TODO: Did get_default() return a reference()? */
-      break;
+  case GST_TAG_IMAGE_TYPE_UNDEFINED:
+  case GST_TAG_IMAGE_TYPE_FRONT_COVER: {
+    RygelMediaArtStore *store = rygel_media_art_store_get_default ();
+    GFile* thumb = rygel_media_art_store_get_media_art_file (store,
+                                                             "album",
+                                                             RYGEL_MUSIC_ITEM (item),
+                                                             TRUE);
+    RygelMediaExportJPEGWriter *writer = rygel_media_export_jpeg_writer_new (NULL);
+
+    if (writer) {
+      rygel_media_export_jpeg_writer_write (writer, buffer, thumb);
+      g_object_unref (writer);
     }
-    default:
-      break;
+
+    g_object_unref (thumb);
+    g_object_unref (store); /* TODO: Did get_default() return a reference()? */
+    break;
+  }
+  default:
+    break;
   }
 
   gst_structure_free (structure);
 
-  return result;
+  return media_item;
 }
 
+void
+rygel_media_export_item_factory_fill_media_item (RygelMediaItem       *item,
+                                                 GFile                *file,
+                                                 GUPnPDLNAInformation *dlna_info,
+                                                 GFileInfo            *file_info) {
+  const GstDiscovererInfo *info;
+  const GstTagList *tags;
+  gchar *title;
+  GDate *date;
+  guint64 mtime;
+  const gchar *name;
+  RygelMediaObject *media_object;
+  gchar *uri;
 
-void rygel_media_export_item_factory_fill_media_item (RygelMediaItem *item, GFile *file, GUPnPDLNAInformation *dlna_info, GFileInfo *file_info) {
   g_return_if_fail (RYGEL_IS_MEDIA_ITEM (item));
   g_return_if_fail (G_IS_FILE (file));
   g_return_if_fail (GUPNP_IS_DLNA_INFORMATION (dlna_info));
   g_return_if_fail (G_IS_FILE_INFO (file_info));
 
-  const GstDiscovererInfo *info = gupnp_dlna_information_get_info (dlna_info);
-  if (!info)
+  info = gupnp_dlna_information_get_info (dlna_info);
+  if (!info) {
     return;
+  }
 
-  const GstTagList *tags = gst_discoverer_info_get_tags (info);
-  gchar *title = NULL;
+  tags = gst_discoverer_info_get_tags (info);
+  title = NULL;
   if (!tags || !gst_tag_list_get_string (tags, GST_TAG_TITLE, &title)) {
     title = g_strdup (g_file_info_get_display_name (file_info));
   }
 
-  rygel_media_object_set_title (RYGEL_MEDIA_OBJECT (item), title);
+  media_object = RYGEL_MEDIA_OBJECT (item);
+  rygel_media_object_set_title (media_object, title);
   g_free (title);
 
-  GDate* date = NULL;
+  date = NULL;
   if (tags) {
     if (gst_tag_list_get_date (tags, GST_TAG_DATE, &date)) {
       gint datestr_length = 30;
       gchar *datestr = g_new0 (gchar, datestr_length);
-      g_date_strftime (datestr, datestr_length, "%F", date);
 
+      g_date_strftime (datestr, datestr_length, "%F", date);
       rygel_media_item_set_date (item, datestr);
       g_free (datestr);
     }
   }
 
   // use mtime if no time tag was available
-  guint64 mtime = g_file_info_get_attribute_uint64 (file_info,
+  mtime = g_file_info_get_attribute_uint64 (file_info,
     G_FILE_ATTRIBUTE_TIME_MODIFIED);
   if (!date) {
     GTimeVal tv = {0};
-                tv.tv_sec = (glong) mtime;
-                tv.tv_usec = (glong) 0;
+    gchar *datestr;
 
-                gchar* datestr = g_time_val_to_iso8601 (&tv);
-                rygel_media_item_set_date (item, datestr);
-                g_free (datestr);
+    tv.tv_sec = (glong) mtime;
+    tv.tv_usec = (glong) 0;
+    datestr = g_time_val_to_iso8601 (&tv);
+    rygel_media_item_set_date (item, datestr);
+    g_free (datestr);
   } else {
     g_date_free (date);
   }
 
+  rygel_media_item_set_size (item, (gint64) g_file_info_get_size (file_info));
+  rygel_media_object_set_modified (media_object, (guint64) mtime);
 
-  rygel_media_item_set_size (item,
-          (gint64)  g_file_info_get_size (file_info));
-  rygel_media_object_set_modified (RYGEL_MEDIA_OBJECT (item), (guint64) mtime);
-
-  const gchar *name = gupnp_dlna_information_get_name (dlna_info);
+  name = gupnp_dlna_information_get_name (dlna_info);
   if (name) {
     rygel_media_item_set_dlna_profile (item, name);
 
-    rygel_media_item_set_mime_type (item,
-      gupnp_dlna_information_get_mime (dlna_info));
+    rygel_media_item_set_mime_type (item, gupnp_dlna_information_get_mime (dlna_info));
   } else {
     const gchar *content_type = g_file_info_get_content_type (file_info);
     gchar *content_type_mime_type = g_content_type_get_mime_type (content_type);
+
     rygel_media_item_set_mime_type (item, content_type_mime_type);
     g_free (content_type_mime_type);
   }
 
-  gchar *uri = g_file_get_uri (file);
+  uri = g_file_get_uri (file);
   rygel_media_item_add_uri (item, uri);
   g_free (uri);
 }


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