diff options
author | Ton Roosendaal <ton@blender.org> | 2006-06-14 16:42:23 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-06-14 16:42:23 +0400 |
commit | b81e5bac741fca9e6938d4608d343a08c5e9d6cc (patch) | |
tree | 3ee9e28193b1458ffe24e696cf0eadde892abdaa /source/blender/src/editsound.c | |
parent | 8988a0de38dcf545447649ac778b145b2fb5e14a (diff) |
Bugfix #4135
Mixdown option (blending sequence audio strips) didn't write proper WAV.
- file length in header chunk was too short (potential crasher)
- endian switch code used swab(), which wasn't defined to work when src and
target is identical
- cleaned up some code too... like removing timecursor() for core loop.
Diffstat (limited to 'source/blender/src/editsound.c')
-rw-r--r-- | source/blender/src/editsound.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c index 30b38d2c2d7..7e685465e4b 100644 --- a/source/blender/src/editsound.c +++ b/source/blender/src/editsound.c @@ -314,12 +314,7 @@ void sound_read_wav_data(bSound* sound, PackedFile* pf) readPackedFile(pf, &shortbuf, 2); if(G.order==B_ENDIAN) { - /* was SWITCH_SHORT before */ - char s_i, *p_i; - p_i= (char *)&(shortbuf); - s_i= p_i[0]; - p_i[0]= p_i[1]; - p_i[1]= s_i; + SWITCH_SHORT(shortbuf); } /* read the number of channels */ @@ -327,12 +322,7 @@ void sound_read_wav_data(bSound* sound, PackedFile* pf) if(G.order==B_ENDIAN) { - /* was SWITCH_SHORT before */ - char s_i, *p_i; - p_i= (char *)&(shortbuf); - s_i= p_i[0]; - p_i[0]= p_i[1]; - p_i[1]= s_i; + SWITCH_SHORT(shortbuf); } /* check the number of channels */ @@ -367,12 +357,7 @@ void sound_read_wav_data(bSound* sound, PackedFile* pf) readPackedFile(pf, &shortbuf, 2); if(G.order==B_ENDIAN) { - /* was SWITCH_SHORT before */ - char s_i, *p_i; - p_i= (char *)&(shortbuf); - s_i= p_i[0]; - p_i[0]= p_i[1]; - p_i[1]= s_i; + SWITCH_SHORT(shortbuf); } bits = shortbuf; |