diff decoders/voc.c @ 477:3e705c9180e5

Fixed binary compatibility, added Sound_GetDuration().
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 12 May 2004 02:15:00 +0000
parents c66080364dff
children 00b61987b555
line wrap: on
line diff
--- a/decoders/voc.c	Sat May 08 22:06:14 2004 +0000
+++ b/decoders/voc.c	Wed May 12 02:15:00 2004 +0000
@@ -245,9 +245,9 @@
 
                 bytes_per_second = sample->actual.rate
                     * sample->actual.channels;
-                sample->total_time += ( v->rest ) / bytes_per_second * 1000;
-		sample->total_time += (v->rest % bytes_per_second) * 1000
-		    / bytes_per_second;
+                internal->total_time += ( v->rest ) / bytes_per_second * 1000;
+                internal->total_time += (v->rest % bytes_per_second) * 1000
+                                            / bytes_per_second;
                 return 1;
 
             case VOC_DATA_16:
@@ -281,11 +281,11 @@
                     return 0;
                 v->rest = sblen - 12;
 
-		bytes_per_second = ((v->size == ST_SIZE_WORD) ? (2) : (1)) *
-		    sample->actual.rate * v->channels;
-                sample->total_time += v->rest / bytes_per_second * 1000;
-                sample->total_time += ( v->rest % bytes_per_second ) * 1000
-		    / bytes_per_second;
+                bytes_per_second = ((v->size == ST_SIZE_WORD) ? (2) : (1)) *
+                                    sample->actual.rate * v->channels;
+                internal->total_time += v->rest / bytes_per_second * 1000;
+                internal->total_time += ( v->rest % bytes_per_second ) * 1000
+                                            / bytes_per_second;
                 return 1;
 
             case VOC_CONT:
@@ -315,8 +315,8 @@
                 v->rest = period;
                 v->silent = 1;
 
-		sample->total_time += (period) / (v->rate) * 1000;
-		sample->total_time += (period % v->rate) * 1000 / v->rate; 
+                internal->total_time += (period) / (v->rate) * 1000;
+                internal->total_time += (period % v->rate) * 1000 / v->rate;
                 return 1;
 
             case VOC_LOOP: