diff options
author | Arnaud Vrac <avrac@freebox.fr> | 2013-01-31 13:49:00 +0100 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2014-09-18 13:21:22 -0300 |
commit | 56775ad5bd52fc1ad48bbaf8cac86b17733f6bd6 (patch) | |
tree | 8600df7450a17baf55dc26b87ea538730723ccf9 | |
parent | 8e0b8981190a34cdeb1b7ef7ce3882c948ea9c3b (diff) | |
download | gstreamer-plugins-base-56775ad5bd52fc1ad48bbaf8cac86b17733f6bd6.tar.gz |
basetextoverlay: get framerate from previously parsed video info
-rw-r--r-- | ext/pango/gstbasetextoverlay.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 00862fdd8..b67452b4d 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -2359,22 +2359,14 @@ gst_base_text_overlay_video_chain (GstPad * pad, GstObject * parent, * duration (we only use those estimated values internally though, we * don't want to set bogus values on the buffer itself) */ if (stop == -1) { - GstCaps *caps; - GstStructure *s; - gint fps_num, fps_denom; - - /* FIXME, store this in setcaps */ - caps = gst_pad_get_current_caps (pad); - s = gst_caps_get_structure (caps, 0); - if (gst_structure_get_fraction (s, "framerate", &fps_num, &fps_denom) && - fps_num && fps_denom) { + if (overlay->info.fps_n && overlay->info.fps_d) { GST_DEBUG_OBJECT (overlay, "estimating duration based on framerate"); - stop = start + gst_util_uint64_scale_int (GST_SECOND, fps_denom, fps_num); + stop = start + gst_util_uint64_scale_int (GST_SECOND, + overlay->info.fps_d, overlay->info.fps_n); } else { GST_LOG_OBJECT (overlay, "no duration, assuming minimal duration"); stop = start + 1; /* we need to assume some interval */ } - gst_caps_unref (caps); } gst_object_sync_values (GST_OBJECT (overlay), GST_BUFFER_TIMESTAMP (buffer)); |