[longomatch] Leave the framerate blank for source expsing ranges



commit a34250324992c50ca396431507138111bcefc42c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Mar 19 10:21:55 2015 +0100

    Leave the framerate blank for source expsing ranges
    
    Otherwise we end up with missleading information such as
    1080p 60fps and 1080p 15fps  With the framerate empaty we
    let the negotiation decide the appropiate framerate

 LongoMatch.Core/Common/Device.cs |    3 +++
 libcesarplayer/lgm-device.c      |   10 ++--------
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Device.cs b/LongoMatch.Core/Common/Device.cs
index b5aa4ff..41727ff 100644
--- a/LongoMatch.Core/Common/Device.cs
+++ b/LongoMatch.Core/Common/Device.cs
@@ -78,6 +78,9 @@ namespace LongoMatch.Core.Common
                        if (width == 0 && height == 0 && fps_n == 0 && fps_d == 0) {
                                return Catalog.GetString ("Default");
                        }
+                       if (fps_n == 0 && fps_d == 0) {
+                               return string.Format ("{0}x{1}", width, height);
+                       }
                        return string.Format ("{0}x{1} {2}fps", width, height,
                                ((double)fps_n / fps_d).ToString ("#.##"));
                }
diff --git a/libcesarplayer/lgm-device.c b/libcesarplayer/lgm-device.c
index 36c09aa..06a886b 100644
--- a/libcesarplayer/lgm-device.c
+++ b/libcesarplayer/lgm-device.c
@@ -204,14 +204,8 @@ lgm_device_parse_structure (GstStructure *s, GHashTable *table)
   } else if (G_VALUE_TYPE (val) == GST_TYPE_FRACTION_RANGE) {
     const GValue *fr_val;
 
-    lgm_device_add_format_from_fps_val (table, width, height,
-        gst_value_get_fraction_range_min (val));
-    /* For sources returning template caps set framerate to 0/0 */
-    fr_val = gst_value_get_fraction_range_min (val);
-    if (!gst_value_get_fraction_numerator (fr_val) == 0) {
-      lgm_device_add_format_from_fps_val (table, width, height,
-          gst_value_get_fraction_range_max (val));
-    }
+    /* For sources returning template caps or ranges set framerate to 0/0 */
+    lgm_device_add_format (table, width, height, 0, 0);
   } else if (G_VALUE_TYPE (val) == GST_TYPE_ARRAY) {
     guint n, len;
 


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