[rygel] media-export: Ignore invalid colorDepth



commit 68c7f99cc7030c8b5e5518e08d18b2e4edbd9368
Author: Mark Ryan <mark d ryan intel com>
Date:   Wed Sep 26 13:58:17 2012 +0200

    media-export: Ignore invalid colorDepth
    
    media-export calls the GStreamer function gst_discoverer_video_info_get_depth
    to determine the color depth of images and videos.  When this function fails
    it returns 0.  The media-export plugin is not currently testing for this error
    case and is treating 0 as a valid color depth.  Rygel in turn is reporting
    a color depth of 0 for some files.  This seems to happen for all JPEGs on
    my machine.  This patch fixes the problem by preventing Rygel from returning
    a colorDepth resource for items whose color depth cannot be determined by
    gst_discoverer_video_info_get_depth.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684868

 .../media-export/rygel-media-export-item.vala      |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index 4a1efa6..292c8a8 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -138,7 +138,9 @@ namespace Rygel.MediaExport.ItemFactory {
 
         item.width = (int) video_info.get_width ();
         item.height = (int) video_info.get_height ();
-        item.color_depth = (int) video_info.get_depth ();
+
+        var color_depth = (int) video_info.get_depth ();
+        item.color_depth = (color_depth == 0) ? -1 : color_depth;
 
         return item;
     }
@@ -152,7 +154,9 @@ namespace Rygel.MediaExport.ItemFactory {
 
         item.width = (int) video_info.get_width ();
         item.height = (int) video_info.get_height ();
-        item.color_depth = (int) video_info.get_depth ();
+
+        var color_depth = (int) video_info.get_depth ();
+        item.color_depth = (color_depth == 0) ? -1 : color_depth;
 
         return item;
     }



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