mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
ext/ffmpeg/gstffmpegcodecmap.c: Better framerate setting.
Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_to_pixfmt): Better framerate setting.
This commit is contained in:
parent
fa992c26d6
commit
10dea5bfbb
3 changed files with 21 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event):
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 39250a956e1dfc010fe9f9d93ca1e2c3a343cdca
|
||||
Subproject commit eac450a673cd1d3a606fe75399d0cd1fcb1d0d7b
|
|
@ -1111,8 +1111,21 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
|
|||
gst_structure_get_int (structure, "bpp", &context->bits_per_sample);
|
||||
|
||||
if (gst_structure_get_double (structure, "framerate", &fps)) {
|
||||
context->time_base.den = fps * DEFAULT_FRAME_RATE_BASE;
|
||||
context->time_base.num = DEFAULT_FRAME_RATE_BASE;
|
||||
GValue dfps = { 0 };
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue