diff options
author | Mark Ryan <mark.d.ryan@intel.com> | 2012-09-26 13:58:17 +0200 |
---|---|---|
committer | Jens Georg <jensg@openismus.com> | 2012-10-06 21:40:44 +0200 |
commit | 68c7f99cc7030c8b5e5518e08d18b2e4edbd9368 (patch) | |
tree | 24d1bcd5b4052042091e3d7eb5c0e2102f3e70b0 | |
parent | 37ee7322869a5550da166f769ade8fcfda754052 (diff) | |
download | rygel-68c7f99cc7030c8b5e5518e08d18b2e4edbd9368.tar.gz |
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
-rw-r--r-- | src/plugins/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 4a1efa63..292c8a8b 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; } |