summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-02-11 05:06:45 +1100
committerJan Schmidt <jan@centricular.com>2015-02-12 23:38:47 +1100
commit2e00311fe1a1a3497a4b49a4a18ed1ef402c2c78 (patch)
tree557c37d610963242a0ee3593ea9ae63a6907a2a4
parentf4b510779611a1495c06be0d7ec8b987d20a78d1 (diff)
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.
-rw-r--r--gst/flv/Makefile.am3
-rw-r--r--gst/flv/gstflvdemux.c3
2 files changed, 4 insertions, 2 deletions
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 <gst/pbutils/descriptions.h>
#include <gst/pbutils/pbutils.h>
#include <gst/audio/audio.h>
+#include <gst/video/video.h>
/* 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);