openalbridge/loaders.c
changeset 2210 1cb7118a77dd
parent 2200 8192be6e3aef
child 2212 6b5da1a2765a
equal deleted inserted replaced
2209:2573d4ff78f9 2210:1cb7118a77dd
   134 	int load_OggVorbis (const char *filename, ALenum *format, uint8_t**data, ALsizei *bitsize, ALsizei *freq) {
   134 	int load_OggVorbis (const char *filename, ALenum *format, uint8_t**data, ALsizei *bitsize, ALsizei *freq) {
   135 		//implementation inspired from http://www.devmaster.net/forums/showthread.php?t=1153
   135 		//implementation inspired from http://www.devmaster.net/forums/showthread.php?t=1153
   136 		FILE			*oggFile;		// ogg handle
   136 		FILE			*oggFile;		// ogg handle
   137 		OggVorbis_File  oggStream;		// stream handle
   137 		OggVorbis_File  oggStream;		// stream handle
   138 		vorbis_info		*vorbisInfo;	// some formatting data
   138 		vorbis_info		*vorbisInfo;	// some formatting data
   139 		vorbis_comment	*vorbisComment;	// other less useful data
       
   140 		int64_t			pcm_length;		// length of the decoded data
   139 		int64_t			pcm_length;		// length of the decoded data
   141 		int size = 0;
   140 		int size = 0;
   142 		int section, result, i;
   141 		int section, result;
       
   142 #ifdef DEBUG
       
   143 		int i;
       
   144 		vorbis_comment	*vorbisComment;	// other less useful data
       
   145 #endif
   143 		
   146 		
   144 		oggFile = Fopen(filename, "rb");
   147 		oggFile = Fopen(filename, "rb");
   145 		result = ov_open(oggFile, &oggStream, NULL, 0);
   148 		result = ov_open(oggFile, &oggStream, NULL, 0);
   146 		//TODO: check returning value of result
   149 		//TODO: check returning value of result
   147 		
   150