mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
matroska-demux: Use gst_util_double_to_fraction() instead of GValue magic
This commit is contained in:
parent
c42bc9efa0
commit
20ad174679
1 changed files with 5 additions and 10 deletions
|
@ -5223,19 +5223,14 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
|
||||||
}
|
}
|
||||||
|
|
||||||
if (videocontext->default_fps > 0.0) {
|
if (videocontext->default_fps > 0.0) {
|
||||||
GValue fps_double = { 0, };
|
gint fps_n, fps_d;
|
||||||
GValue fps_fraction = { 0, };
|
|
||||||
|
|
||||||
g_value_init (&fps_double, G_TYPE_DOUBLE);
|
gst_util_double_to_fraction (videocontext->default_fps, &fps_n, &fps_d);
|
||||||
g_value_init (&fps_fraction, GST_TYPE_FRACTION);
|
|
||||||
g_value_set_double (&fps_double, videocontext->default_fps);
|
|
||||||
g_value_transform (&fps_double, &fps_fraction);
|
|
||||||
|
|
||||||
GST_DEBUG ("using default fps %f", videocontext->default_fps);
|
GST_DEBUG ("using default fps %d/%d", fps_n, fps_d);
|
||||||
|
|
||||||
gst_structure_set_value (structure, "framerate", &fps_fraction);
|
gst_structure_set (structure, "framerate", GST_TYPE_FRACTION, fps_n,
|
||||||
g_value_unset (&fps_double);
|
fps_d, NULL);
|
||||||
g_value_unset (&fps_fraction);
|
|
||||||
} else if (context->default_duration > 0) {
|
} else if (context->default_duration > 0) {
|
||||||
int fps_n, fps_d;
|
int fps_n, fps_d;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue