/usr/bin/cvs -z2 di -cp
Index: matroska-mux.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-mux.c,v
retrieving revision 1.40
diff -c -p -c -p -r1.40 matroska-mux.c
*** matroska-mux.c	1 Apr 2006 09:56:45 -0000	1.40
--- matroska-mux.c	25 Apr 2006 08:51:45 -0000
*************** gst_matroska_mux_best_pad (GstMatroskaMu
*** 1298,1304 ****
   */
  GstBuffer *
  gst_matroska_mux_create_buffer_header (GstMatroskaTrackContext * track,
!     guint16 relative_timestamp, int flags)
  {
    GstBuffer *hdr;
  
--- 1298,1304 ----
   */
  GstBuffer *
  gst_matroska_mux_create_buffer_header (GstMatroskaTrackContext * track,
!     gint16 relative_timestamp, int flags)
  {
    GstBuffer *hdr;
  
*************** gst_matroska_mux_write_data (GstMatroska
*** 1330,1336 ****
    GstBuffer *buf, *hdr;
    guint64 cluster, blockgroup;
    gboolean write_duration;
!   guint16 relative_timestamp;
    guint64 block_duration;
  
    /* write data */
--- 1330,1337 ----
    GstBuffer *buf, *hdr;
    guint64 cluster, blockgroup;
    gboolean write_duration;
!   gint16 relative_timestamp;
!   gint64 relative_timestamp64;
    guint64 block_duration;
  
    /* write data */
*************** gst_matroska_mux_write_data (GstMatroska
*** 1430,1437 ****
    /* write the block, for matroska v2 use SimpleBlock if possible
     * one slice (*breath*).
     * FIXME: lacing, etc. */
!   relative_timestamp =
!       (GST_BUFFER_TIMESTAMP (buf) - mux->cluster_time) / mux->time_scale;
    if (mux->matroska_version > 1 && !write_duration) {
      int flags =
          GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT) ? 0 : 0x80;
--- 1431,1445 ----
    /* write the block, for matroska v2 use SimpleBlock if possible
     * one slice (*breath*).
     * FIXME: lacing, etc. */
!   relative_timestamp64 = GST_BUFFER_TIMESTAMP (buf) - mux->cluster_time;
!   if (relative_timestamp64 >= 0) {
!       /* round the timestamp */
!       relative_timestamp64 += mux->time_scale / 2;
!   } else {
!       /* round the timestamp */
!       relative_timestamp64 -= mux->time_scale / 2;
!   }
!   relative_timestamp = relative_timestamp64 / (int64_t) mux->time_scale;
    if (mux->matroska_version > 1 && !write_duration) {
      int flags =
          GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT) ? 0 : 0x80;
