music_ogg.c
changeset 281 33730d0864d8
parent 246 9fa5d0f9d042
child 312 8a536296ef3d
equal deleted inserted replaced
280:1e6fd744d20c 281:33730d0864d8
   190 		music->playing = 0;
   190 		music->playing = 0;
   191 	}
   191 	}
   192 }
   192 }
   193 
   193 
   194 /* Play some of a stream previously started with OGG_play() */
   194 /* Play some of a stream previously started with OGG_play() */
   195 void OGG_playAudio(OGG_music *music, Uint8 *snd, int len)
   195 int OGG_playAudio(OGG_music *music, Uint8 *snd, int len)
   196 {
   196 {
   197 	int mixable;
   197 	int mixable;
   198 
   198 
   199 	while ( (len > 0) && music->playing ) {
   199 	while ( (len > 0) && music->playing ) {
   200 		if ( ! music->len_available ) {
   200 		if ( ! music->len_available ) {
   213 		music->len_available -= mixable;
   213 		music->len_available -= mixable;
   214 		music->snd_available += mixable;
   214 		music->snd_available += mixable;
   215 		len -= mixable;
   215 		len -= mixable;
   216 		snd += mixable;
   216 		snd += mixable;
   217 	}
   217 	}
       
   218 	
       
   219 	return len;
   218 }
   220 }
   219 
   221 
   220 /* Stop playback of a stream previously started with OGG_play() */
   222 /* Stop playback of a stream previously started with OGG_play() */
   221 void OGG_stop(OGG_music *music)
   223 void OGG_stop(OGG_music *music)
   222 {
   224 {