From 2e00311fe1a1a3497a4b49a4a18ed1ef402c2c78 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 11 Feb 2015 05:06:45 +1100 Subject: flvdemux: Use gst_video_guess_framerate() Use gst_video_guess_framerate() from libgstvideo to guess sensible common framerates where possible from the floating point fps in the stream. --- gst/flv/Makefile.am | 3 ++- gst/flv/gstflvdemux.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'gst') diff --git a/gst/flv/Makefile.am b/gst/flv/Makefile.am index 7c1c52b8e..e6e657899 100644 --- a/gst/flv/Makefile.am +++ b/gst/flv/Makefile.am @@ -1,7 +1,8 @@ plugin_LTLIBRARIES = libgstflv.la libgstflv_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) -libgstflv_la_LIBADD = -lgstpbutils-@GST_API_VERSION@ -lgstaudio-@GST_API_VERSION@\ +libgstflv_la_LIBADD = -lgstpbutils-@GST_API_VERSION@ -lgstaudio-@GST_API_VERSION@ \ + -lgstvideo-@GST_API_VERSION@ \ $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) libgstflv_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} libgstflv_la_SOURCES = gstflvdemux.c gstflvmux.c diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index be073ed26..30c8cc13e 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -43,6 +43,7 @@ #include #include #include +#include /* FIXME: don't rely on own GstIndex */ #include "gstindex.c" @@ -1255,7 +1256,7 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag) if (G_LIKELY (demux->framerate)) { gint num = 0, den = 0; - gst_util_double_to_fraction (demux->framerate, &num, &den); + gst_video_guess_framerate (GST_SECOND / demux->framerate, &num, &den); GST_DEBUG_OBJECT (demux->video_pad, "fps to be used on caps %f (as a fraction = %d/%d)", demux->framerate, num, den); -- cgit v1.2.3