~ubuntu-branches/ubuntu/lucid/blender/lucid

« back to all changes in this revision

Viewing changes to intern/SoundSystem/intern/SND_Utils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-08-06 22:32:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806223219-8z4eej1u8levu4pz
Tags: 2.49a+dfsg-0ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Build-depend on python-2.6 rather than python-2.5.
  - debian/misc/*.desktop: Add Spanish translation to .desktop 
    files.
  - debian/pyversions: 2.6.
  - debian/rules: Clean *.o of source/blender/python/api2_2x/
* New upstream release (LP: #382153).
* Refreshed patches:
  - 01_sanitize_sys.patch
  - 02_tmp_in_HOME
  - 10_use_systemwide_ftgl
  - 70_portability_platform_detection
* Removed patches merged upstream:
  - 30_fix_python_syntax_warning
  - 90_ubuntu_ffmpeg_52_changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Util functions for soundthingies
5
5
 *
6
 
 * $Id: SND_Utils.cpp 17039 2008-10-12 10:39:45Z campbellbarton $
 
6
 * $Id: SND_Utils.cpp 19395 2009-03-24 09:09:10Z campbellbarton $
7
7
 *
8
8
 * ***** BEGIN GPL LICENSE BLOCK *****
9
9
 *
40
40
#include <math.h>
41
41
#include <string.h>
42
42
 
43
 
#if defined(WIN32)
 
43
#if defined(_WIN32)
44
44
#include <io.h>
 
45
#define open _open
 
46
#define read _read
 
47
#define close _close
 
48
#define write _write
 
49
#define lseek _lseek
45
50
#else
46
51
#include <unistd.h>
47
52
#endif
153
158
 
154
159
                        if (shortbuf == SND_WAVE_FORMAT_PCM)
155
160
                                result = true;
156
 
                        
157
 
                        /* only fmod supports compressed wav */
158
 
#ifdef USE_FMOD
159
 
                        switch (shortbuf)
160
 
                        {
161
 
                                case SND_WAVE_FORMAT_ADPCM:
162
 
                                case SND_WAVE_FORMAT_ALAW:
163
 
                                case SND_WAVE_FORMAT_MULAW:
164
 
                                case SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM:
165
 
                                case SND_WAVE_FORMAT_CONTROL_RES_VQLPC:
166
 
                                case SND_WAVE_FORMAT_GSM_610:
167
 
                                case SND_WAVE_FORMAT_MPEG3:
168
 
                                        result = true;
169
 
                                        break;
170
 
                                default:
171
 
                                        {
172
 
                                                break;
173
 
                                        }
174
 
                        }
175
 
#endif
176
 
                }
177
 
#ifdef USE_FMOD
178
 
                /* only valid publishers may use ogg vorbis */
179
 
                else if (!memcmp(buffer, "OggS", 4))
180
 
                {
181
 
                        result = true;
182
 
                }
183
 
                /* only valid publishers may use mp3 */
184
 
                else if (((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "��", 2))))
185
 
                {
186
 
                        result = true;
187
 
                }
188
 
#endif
 
161
                }
189
162
        }
190
163
        if (loadedsample)
191
164
        {