=== modified file 'ext/annodex/gstcmmlenc.c'
--- ext/annodex/gstcmmlenc.c	2006-07-29 14:32:26 +0000
+++ ext/annodex/gstcmmlenc.c	2006-08-07 18:00:05 +0000
@@ -259,6 +259,7 @@
       gst_cmml_track_list_destroy (enc->tracks);
       enc->tracks = NULL;
       g_free (enc->preamble);
+      enc->preamble = NULL;
       gst_cmml_parser_free (enc->parser);
       break;
     }
@@ -507,6 +508,13 @@
       (gchar *) clip->track);
   if (prev_clip) {
     prev_clip_time = prev_clip->start_time;
+    if (prev_clip_time > clip->start_time) {
+      GST_ERROR_OBJECT (enc,
+          "previous clip start time > current clip (%s) start time", clip->id);
+      enc->flow_return = GST_FLOW_ERROR;
+      return;
+    }
+
     /* we don't need the prev clip anymore */
     gst_cmml_track_list_del_clip (enc->tracks, prev_clip);
   }
@@ -526,12 +534,6 @@
   gchar *clip_string;
   gint64 granulepos;
 
-  if (prev_clip_time != GST_CLOCK_TIME_NONE &&
-      prev_clip_time > clip->start_time) {
-    GST_WARNING_OBJECT (enc,
-        "previous clip start time > current clip (%s) start time", clip->id);
-  }
-
   /* encode the clip */
   clip_string =
       (gchar *) gst_cmml_parser_tag_clip_to_string (enc->parser, clip);

=== modified file 'ext/annodex/gstcmmlutils.c'
--- ext/annodex/gstcmmlutils.c	2006-07-29 14:32:26 +0000
+++ ext/annodex/gstcmmlutils.c	2006-08-04 21:56:29 +0000
@@ -58,15 +58,17 @@
 
     seconds_t = seconds * GST_SECOND;
   } else {
+    guint64 u64seconds;
+
     /* parse npt-sec */
     hours_t = 0;
     minutes = 0;
-    fields = sscanf (time, "%d.%d", &seconds, &mseconds);
+    fields = sscanf (time, "%llu.%d", &u64seconds, &mseconds);
     if (seconds < 0)
       goto bad_input;
 
-    seconds_t = gst_util_uint64_scale (seconds, GST_SECOND, 1);
-    if (seconds == G_MAXUINT64)
+    seconds_t = gst_util_uint64_scale (u64seconds, GST_SECOND, 1);
+    if (seconds_t == G_MAXUINT64)
       goto overflow;
   }
 
@@ -177,7 +179,7 @@
     GstClockTime current_time, gint64 granulerate_n, gint64 granulerate_d,
     guint8 granuleshift)
 {
-  gint64 keyindex, keyoffset, granulepos;
+  guint64 keyindex, keyoffset, granulepos;
   gint64 granulerate;
 
   if (prev_time == GST_CLOCK_TIME_NONE)
@@ -301,16 +303,13 @@
   GstCmmlTrack *track;
   GList *walk;
   GstCmmlTagClip *tmp;
-  gchar *clip_id = (gchar *) clip->id;
   gboolean res = FALSE;
 
-  g_return_val_if_fail (clip_id != NULL, FALSE);
-
-  track = g_hash_table_lookup (tracks, clip_id);
+  track = g_hash_table_lookup (tracks, (gchar *) clip->track);
   if (track) {
     for (walk = track->clips; walk; walk = g_list_next (walk)) {
       tmp = GST_CMML_TAG_CLIP (walk->data);
-      if (!strcmp ((gchar *) tmp->id, clip_id)) {
+      if (tmp->start_time == clip->start_time) {
         res = TRUE;
         break;
       }

