diff options
author | Christian Berentsen <christian.berentsen@cisco.com> | 2010-11-29 13:47:11 +0100 |
---|---|---|
committer | Ole André Vadla Ravnås <oravnas@cisco.com> | 2010-12-10 04:06:53 +0100 |
commit | 6cf92cd25c0322058e9e59cd840e46a9dca98c97 (patch) | |
tree | afdcace9bb41120e92653f08593a8af6203259d5 | |
parent | 0c36c70f63ddc2e8689fa3762e4e21fa572a1dd7 (diff) |
winks: fix framerate fraction range mapping
Min and max may be slightly different but compress to the same fraction.
-rw-r--r-- | sys/winks/ksvideohelpers.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/winks/ksvideohelpers.c b/sys/winks/ksvideohelpers.c index 8399762e6..1772e5bcc 100644 --- a/sys/winks/ksvideohelpers.c +++ b/sys/winks/ksvideohelpers.c @@ -309,6 +309,7 @@ ks_video_append_video_stream_cfg_fields (GstStructure * structure, const KS_VIDEO_STREAM_CONFIG_CAPS * vscc) { GValue val = { 0, }; + gint64 min_n, min_d; gint64 max_n, max_d; g_return_val_if_fail (structure, FALSE); @@ -335,16 +336,13 @@ ks_video_append_video_stream_cfg_fields (GstStructure * structure, } /* framerate */ + compress_fraction (NANOSECONDS, vscc->MinFrameInterval, &min_n, &min_d); compress_fraction (NANOSECONDS, vscc->MaxFrameInterval, &max_n, &max_d); - if (vscc->MinFrameInterval == vscc->MaxFrameInterval) { + if (min_n == max_n && min_d == max_d) { g_value_init (&val, GST_TYPE_FRACTION); gst_value_set_fraction (&val, max_n, max_d); } else { - gint64 min_n, min_d; - - compress_fraction (NANOSECONDS, vscc->MinFrameInterval, &min_n, &min_d); - g_value_init (&val, GST_TYPE_FRACTION_RANGE); gst_value_set_fraction_range_full (&val, max_n, max_d, min_n, min_d); } |