support for delay/seek value in soundstreamblock.
authorkramm <kramm>
Fri, 7 Feb 2003 08:45:37 +0000 (08:45 +0000)
committerkramm <kramm>
Fri, 7 Feb 2003 08:45:37 +0000 (08:45 +0000)
lib/modules/swfsound.c
lib/rfxswf.h

index fe3461d..d0bfc20 100644 (file)
@@ -127,7 +127,7 @@ void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples)
     swf_SetU16(tag,avgnumsamples);
 }
 
     swf_SetU16(tag,avgnumsamples);
 }
 
-void swf_SetSoundStreamBlock(TAG*tag, S16*samples, char first)
+void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first)
 {
     char*buf;
     int oldlen=0,len = 0;
 {
     char*buf;
     int oldlen=0,len = 0;
@@ -142,7 +142,7 @@ void swf_SetSoundStreamBlock(TAG*tag, S16*samples, char first)
        int fs = lame_get_framesize(lame_flags);
        //printf("framesize:%d\n", fs);
        swf_SetU16(tag, fs); // samples per mp3 frame
        int fs = lame_get_framesize(lame_flags);
        //printf("framesize:%d\n", fs);
        swf_SetU16(tag, fs); // samples per mp3 frame
-       swf_SetU16(tag, 0); // seek
+       swf_SetU16(tag, seek); // seek
     }
 
     len += lame_encode_buffer(lame_flags, samples, samples, numsamples, &buf[len], bufsize-len);
     }
 
     len += lame_encode_buffer(lame_flags, samples, samples, numsamples, &buf[len], bufsize-len);
index 2dc338d..6da4a50 100644 (file)
@@ -38,6 +38,7 @@ extern "C" {
 
 /* little/big endian stuff */
 
 
 /* little/big endian stuff */
 
+#define PUT8(ptr,x) {((U8*)(ptr))[0]=x;}
 #define PUT16(ptr,x) {((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);}
 #define PUT32(ptr,x) {((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);((U8*)(ptr))[2]=(U8)((x)>>16);((U8*)(ptr))[3]=(U8)((x)>>24);}
 #define GET16(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8))
 #define PUT16(ptr,x) {((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);}
 #define PUT32(ptr,x) {((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);((U8*)(ptr))[2]=(U8)((x)>>16);((U8*)(ptr))[3]=(U8)((x)>>24);}
 #define GET16(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8))
@@ -653,7 +654,7 @@ int swf_SetLosslessBitsGrayscale(TAG * t,U16 width,U16 height,U8 * bitmap);
 
 // swfsound.c
 void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);
 
 // swfsound.c
 void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);
-void swf_SetSoundStreamBlock(TAG*tag, S16*samples, char first); /* expects 2304 samples */
+void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first); /* expects 2304 samples */
 
 void swf_SetSoundDefine(TAG*tag, S16*samples, int num);
 
 
 void swf_SetSoundDefine(TAG*tag, S16*samples, int num);