Fixed a bug in the riff parser with the allignment of the chunks. This should solve...
authorWim Taymans <wim.taymans@gmail.com>
Sat, 15 Jul 2000 13:26:28 +0000 (13:26 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sat, 15 Jul 2000 13:26:28 +0000 (13:26 +0000)
Original commit message from CVS:
Fixed a bug in the riff parser with the allignment of the chunks. This
should solve the errors with avi playback.

gst/gstutils.c
gst/gstutils.h
libs/riff/gstriffparse.c

index d659fd5..cc63170 100644 (file)
@@ -75,3 +75,21 @@ GtkWidget *gst_util_get_widget_arg(GtkObject *object,guchar *argname) {
   gtk_object_getv(GTK_OBJECT(object),1,&arg);
   return GTK_WIDGET(GTK_VALUE_OBJECT(arg));
 }
+
+void gst_util_dump_mem(guchar *mem, guint size) {
+  guint i, j;
+
+  i = j =0;
+  while (i<size) {
+    g_print("%02x ", mem[i]);
+    if (j == 16) {
+      g_print("\n");
+      j = 0;
+    }
+    else {
+      j++;
+    }
+    i++;
+  }
+  g_print("\n");
+}
index f196c5a..521e73e 100644 (file)
@@ -31,5 +31,6 @@ guchar *gst_util_get_string_arg(GtkObject *object,guchar *argname);
 gpointer gst_util_get_pointer_arg(GtkObject *object,guchar *argname);
 GtkWidget *gst_util_get_widget_arg(GtkObject *object,guchar *argname);
 
+void gst_util_dump_mem(guchar *mem, guint size);
 
 #endif /* __GST_UTILS_H__ */
index 2a6b9f0..3c109b9 100644 (file)
@@ -118,6 +118,7 @@ gint gst_riff_parser_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off) {
     }
   }
 
+  if (riff->nextlikely & 0x01) riff->nextlikely++;
 
   DEBUG("gst_riff_parser: next 0x%08x  last 0x%08lx offset %08x\n",riff->nextlikely, last, off);
   /* loop while the next likely chunk header is in this buffer */
@@ -148,7 +149,7 @@ gint gst_riff_parser_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off) {
     chunk->size = words[1];
     chunk->data = (gchar *)(words+2);
     // we need word alignment
-    if (chunk->size & 0x01) chunk->size++;
+    //if (chunk->size & 0x01) chunk->size++;
     chunk->form = words[2]; /* fill in the form,  might not be valid */
 
 
@@ -186,6 +187,7 @@ gint gst_riff_parser_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off) {
         }
         g_free(chunk);
       }
+      if (riff->nextlikely & 0x01) riff->nextlikely++;
 
       //riff->chunks = g_list_prepend(riff->chunks,chunk);
     }