Commit 10dea5bf authored by Wim Taymans's avatar Wim Taymans

ext/ffmpeg/gstffmpegcodecmap.c: Better framerate setting.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_to_pixfmt):
Better framerate setting.
parent fa992c26
2005-09-19 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_to_pixfmt):
Better framerate setting.
2005-09-16 Thomas Vander Stichele <thomas at apestaart dot org> 2005-09-16 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event): * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event):
......
common @ eac450a6
Subproject commit 39250a956e1dfc010fe9f9d93ca1e2c3a343cdca Subproject commit eac450a673cd1d3a606fe75399d0cd1fcb1d0d7b
...@@ -1111,8 +1111,21 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, ...@@ -1111,8 +1111,21 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
gst_structure_get_int (structure, "bpp", &context->bits_per_sample); gst_structure_get_int (structure, "bpp", &context->bits_per_sample);
if (gst_structure_get_double (structure, "framerate", &fps)) { if (gst_structure_get_double (structure, "framerate", &fps)) {
context->time_base.den = fps * DEFAULT_FRAME_RATE_BASE; GValue dfps = { 0 };
context->time_base.num = DEFAULT_FRAME_RATE_BASE; GValue framerate = { 0 };
/* convert double to fraction for the framerate */
g_value_init (&dfps, G_TYPE_DOUBLE);
g_value_init (&framerate, GST_TYPE_FRACTION);
g_value_set_double (&dfps, fps);
g_value_transform (&dfps, &framerate);
/* somehow these seem mixed up.. */
context->time_base.den = gst_value_get_fraction_numerator (&framerate);
context->time_base.num = gst_value_get_fraction_denominator (&framerate);
GST_DEBUG ("setting framerate %d/%d = %lf",
context->time_base.den, context->time_base.num, fps);
} }
if (!raw) if (!raw)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment