Commits

zeroth  committed 9e5611b

Fixed an issue where pausing would not pause sound. Unpausing still
doesn't work quite right.

  • Participants
  • Parent commits 4a9a97d
  • Branches tylerthemovie

Comments (0)

Files changed (3)

File src/_gmovie.c

 	int filled =0;
 	len1=0;
 	int co = 0;
-	for(;co<10;co++)
+	for(;co<2;co++)
 	{
 		if(movie->audio_paused && !movie->paused)
 		{

File src/_gsound.c

 #define _MIXER_DEFAULT_CHANNELS 2
 #define _MIXER_DEFAULT_CHUNKSIZE 4096
 
-SDL_cond *audio_sig;
 BufferQueue queue;
 int playing =0;
+int s_channel;
 int queue_get(BufferQueue *q, BufferNode **pkt1)
 {
 	//BufferNode *pkt1;
 }
 
 //initialize the mixer audio subsystem, code cribbed from mixer.c
-int soundInit  (int freq, int size, int channels, int chunksize, SDL_cond *cond)
+int soundInit  (int freq, int size, int channels, int chunksize)
 {
 	Uint16 fmt = 0;
     int i;
             SDL_QuitSubSystem (SDL_INIT_AUDIO);
             return -1;
         }
-
+		s_channel = 0;
         /* A bug in sdl_mixer where the stereo is reversed for 8 bit.
            So we use this CPU hogging effect to reverse it for us.
            Hopefully this bug is fixed in SDL_mixer 1.2.9
         Mix_VolumeMusic (127);
         Mix_ChannelFinished(&cb_mixer);
     }
-    audio_sig=cond;
-    if(audio_sig)
-	{
-		SDL_CondSignal(audio_sig);
-	}
+    
 	
 	queue.size=0;
 	queue.first=queue.last=NULL;	
 	mix->alen = (Uint32 )len;
 	mix->volume = 127;
 	playing = 1;
-	int ret = Mix_PlayChannel(-1, mix, 0);
+	int ret = Mix_PlayChannel(s_channel, mix, 0);
+	s_channel = ret;
 	//if buffer was allocated, we gotta clean it up.
 	if(allocated)
 	{

File src/_gsound.h

 	int size;
 } BufferQueue;
 
-int soundInit  (int freq, int size, int channels, int chunksize, SDL_cond *cond);
+int soundInit  (int freq, int size, int channels, int chunksize);
 int soundQuit  (void);
 int playBuffer (uint8_t *buf, uint32_t len, int channel);
 int stopBuffer (int channel);