changeset 12088:f52e662bf365

although this SSE fix is an ugly hack it seems to work fine for me
author faust3
date Thu, 01 Apr 2004 10:35:30 +0000
parents 296582b19611
children 1fe597788e3f
files liba52/parse.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liba52/parse.c	Thu Apr 01 10:19:57 2004 +0000
+++ b/liba52/parse.c	Thu Apr 01 10:35:30 2004 +0000
@@ -57,6 +57,19 @@
     downmix_accel_init(mm_accel);
 
     samples = memalign (16, 256 * 12 * sizeof (sample_t));
+#if defined(__MINGW32__) && defined(HAVE_SSE) 
+    for(i=0;i<10;i++){
+      if((int)samples%16){
+        sample_t* samplestmp=malloc(256 * 12 * sizeof (sample_t));   
+        free(samples);
+        samples = samplestmp;    
+      }
+      else break;
+    }
+    if((int)samples%16){
+      printf("unable to get 16 bit aligned memory => expect crashes when using SSE instructions\n");
+    }
+#endif
     if (samples == NULL)
 	return NULL;