~njh-aelius/maxosx/musicbrainz-tags

« back to all changes in this revision

Viewing changes to Decoders/WavPackDecoder.m

  • Committer: stephen_booth
  • Date: 2008-04-26 21:17:30 UTC
  • Revision ID: svn-v4:6b6cea13-1402-0410-9567-a7afb52bf336:trunk:1369
Correct 24-bit audio handling for PPC.
Fixes #6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
                                // Convert to big endian byte order 
122
122
                                alias8 = [buffer exposeBufferForWriting];
123
123
                                for(sample = 0; sample < samplesRead * [self pcmFormat].mChannelsPerFrame; ++sample) {
124
 
                                        audioSample     = OSSwapHostToBigInt32(inputBuffer[sample]);
125
 
                                        // Skip the lowest byte
 
124
                                        audioSample     = inputBuffer[sample];
 
125
                                        
 
126
                                        // Skip the highest byte
 
127
                                        *alias8++       = (int8_t)((audioSample & 0x00ff0000) >> 16);
126
128
                                        *alias8++       = (int8_t)((audioSample & 0x0000ff00) >> 8);
127
 
                                        *alias8++       = (int8_t)((audioSample & 0x00ff0000) >> 16);
128
 
                                        *alias8++       = (int8_t)((audioSample & 0xff000000) >> 24);
 
129
                                        *alias8++       = (int8_t)((audioSample & 0x000000ff) /*>> 0*/);                                        
129
130
                                }
130
131
                                        
131
132
                                [buffer wroteBytes:samplesRead * [self pcmFormat].mChannelsPerFrame * 3 * sizeof(int8_t)];