+2006-12-11 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
+ (gst_matroska_demux_video_caps):
+ * gst/matroska/matroska-ids.c:
+ (gst_matroska_track_init_video_context):
+ * gst/matroska/matroska-ids.h:
+ Try harder to extract the framerate for video tracks correctly and
+ save it directly instead of converting it back and forth a few
+ times. Mostly makes a difference for very small framerates (<1).
+ Fixes #380199.
+
2006-12-11 Tim-Philipp Müller <tim at centricular dot net>
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_init),
res = FALSE;
break;
}
- context->default_duration = GST_SECOND * (1. / num);
+ context->default_duration =
+ gst_gdouble_to_guint64 ((gdouble) GST_SECOND * (1.0 / num));
+ videocontext->default_fps = num;
break;
}
videocontext->display_height * videocontext->pixel_width, NULL);
}
- if (context->default_duration > 0) {
- GValue fps_double = { 0 };
- GValue fps_fraction = { 0 };
+ if (videocontext->default_fps > 0.0) {
+ GValue fps_double = { 0, };
+ GValue fps_fraction = { 0, };
g_value_init (&fps_double, G_TYPE_DOUBLE);
g_value_init (&fps_fraction, GST_TYPE_FRACTION);
- g_value_set_double (&fps_double,
- gst_guint64_to_gdouble (GST_SECOND / context->default_duration));
+ g_value_set_double (&fps_double, videocontext->default_fps);
+ g_value_transform (&fps_double, &fps_fraction);
+
+ gst_structure_set_value (structure, "framerate", &fps_fraction);
+ g_value_unset (&fps_double);
+ g_value_unset (&fps_fraction);
+ } else if (context->default_duration > 0) {
+ GValue fps_double = { 0, };
+ GValue fps_fraction = { 0, };
+
+ g_value_init (&fps_double, G_TYPE_DOUBLE);
+ g_value_init (&fps_fraction, GST_TYPE_FRACTION);
+ g_value_set_double (&fps_double, (gdouble) GST_SECOND * 1.0 /
+ gst_guint64_to_gdouble (context->default_duration));
g_value_transform (&fps_double, &fps_fraction);
gst_structure_set_value (structure, "framerate", &fps_fraction);
typedef struct _GstMatroskaTrackVideoContext {
GstMatroskaTrackContext parent;
- guint pixel_width, pixel_height,
- display_width, display_height;
+ guint pixel_width, pixel_height;
+ guint display_width, display_height;
+ gdouble default_fps;
GstMatroskaEyeMode eye_mode;
GstMatroskaAspectRatioMode asr_mode;
guint32 fourcc;