Index: matroska-demux.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-demux.c,v
retrieving revision 1.89
diff -u -p -r1.89 matroska-demux.c
--- matroska-demux.c	15 Nov 2006 11:19:13 -0000	1.89
+++ matroska-demux.c	11 Dec 2006 12:53:41 -0000
@@ -660,7 +660,9 @@ gst_matroska_demux_add_stream (GstMatros
                 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;
             }
 
@@ -3615,14 +3617,26 @@ gst_matroska_demux_video_caps (GstMatros
             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);
Index: matroska-ids.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-ids.c,v
retrieving revision 1.2
diff -u -p -r1.2 matroska-ids.c
--- matroska-ids.c	22 Jun 2006 16:27:03 -0000	1.2
+++ matroska-ids.c	11 Dec 2006 12:53:41 -0000
@@ -56,6 +56,7 @@ gst_matroska_track_init_video_context (G
   video_context->eye_mode = 0;
   video_context->asr_mode = 0;
   video_context->fourcc = 0;
+  video_context->default_fps = 0.0;
   return TRUE;
 }
 
Index: matroska-ids.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-ids.h,v
retrieving revision 1.23
diff -u -p -r1.23 matroska-ids.h
--- matroska-ids.h	4 Sep 2006 16:21:17 -0000	1.23
+++ matroska-ids.h	11 Dec 2006 12:53:41 -0000
@@ -292,8 +292,9 @@ typedef struct _GstMatroskaTrackContext 
 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;
