changeset 1998:8f3188746b64

chase last changeset in aud
author William Pitcock <nenolod@atheme.org>
date Mon, 08 Oct 2007 02:02:02 -0500
parents 9d0f5be50219
children 3afd18361a10
files src/aac/libmp4.c src/adplug/adplug-xmms.cc src/alac/plugin.c src/amidi-plug/amidi-plug.c src/cdaudio-ng/cdaudio-ng.c src/console/Audacious_Driver.cxx src/flacng/plugin.c src/madplug/decoder.c src/metronom/metronom.c src/modplug/modplugbmp.cxx src/modplug/modplugbmp.h src/musepack/libmpc.cxx src/sexypsf/plugin.c src/sid/xmms-sid.c src/timidity/xmms-timidity.c src/tonegen/tonegen.c src/tta/libtta.c src/vorbis/vorbis.c src/vtx/vtx.c src/wav/wav-sndfile.c src/wav/wav.c src/wavpack/libwavpack.cxx src/wma/wma.c
diffstat 23 files changed, 35 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/src/aac/libmp4.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/aac/libmp4.c	Mon Oct 08 02:02:02 2007 -0500
@@ -600,7 +600,7 @@
             playback->output->close_audio();
             return FALSE;
         }
-        produce_audio(playback->output->written_time(),
+        playback->pass_audio(playback,
                    FMT_S16_NE,
                    channels,
                    frameInfo.samples<<1,
@@ -770,7 +770,7 @@
             continue;
         }
 
-        produce_audio(playback->output->written_time(),
+        playback->pass_audio(playback,
                    FMT_S16_LE, channels,
                    samplesdecoded<<1, sample_buffer, &buffer_playing);
     }
--- a/src/adplug/adplug-xmms.cc	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/adplug/adplug-xmms.cc	Mon Oct 08 02:02:02 2007 -0500
@@ -847,9 +847,7 @@
     }
 
     // write sound buffer
-    while (playback->output->buffer_free () < SNDBUFSIZE * sampsize)
-      g_usleep (10000);
-    produce_audio (playback->output->written_time (),
+    playback->pass_audio(playback,
                    bit16 ? FORMAT_16 : FORMAT_8,
                    stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL);
 
--- a/src/alac/plugin.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/alac/plugin.c	Mon Oct 08 02:02:02 2007 -0500
@@ -285,7 +285,7 @@
         /* write */
         bytes_read += outputBytes;
 
-        produce_audio(playback->output->written_time(), FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
+        playback->pass_audio(playback, FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
     }
 
     free(buffer);
--- a/src/amidi-plug/amidi-plug.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/amidi-plug/amidi-plug.c	Mon Oct 08 02:02:02 2007 -0500
@@ -757,9 +757,7 @@
   {
     if ( backend.seq_output( &buffer , &buffer_size ) )
     {
-      while( ( playback->output->buffer_free() < buffer_size ) && ( going == TRUE ) )
-        G_USLEEP(10000);
-      produce_audio( playback->output->written_time() ,
+      playback->pass_audio( playback ,
                      FMT_S16_NE , 2 , buffer_size , buffer , &going );
     }
     g_mutex_lock( amidiplug_playing_mutex );
--- a/src/cdaudio-ng/cdaudio-ng.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/cdaudio-ng/cdaudio-ng.c	Mon Oct 08 02:02:02 2007 -0500
@@ -900,7 +900,8 @@
 				usleep(1000);
 				/* play the sound :) */
 			if (pdae_params->pplayback->playing && pdae_params->seektime == -1)
-				produce_audio(pdae_params->pplayback->output->written_time(), FMT_S16_LE, 2, bytecount, bytebuff, &pdae_params->pplayback->playing);
+				pdae_params->pplayback->pass_audio(pdae_params->pplayback, FMT_S16_LE, 2, 
+					bytecount, bytebuff, &pdae_params->pplayback->playing);
 			remainingbytes -= bytecount;
 			bytebuff += bytecount;
 		}
--- a/src/console/Audacious_Driver.cxx	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/console/Audacious_Driver.cxx	Mon Oct 08 02:02:02 2007 -0500
@@ -309,7 +309,7 @@
 				end_delay = emu->sample_rate() * (int) (seconds * 2) / buf_size;
 			}
 		}
-		produce_audio( playback->output->written_time(), 
+		playback->pass_audio( playback, 
 			FMT_S16_NE, 1, sizeof buf, buf, 
 			&console_ip_is_going );
 	}
--- a/src/flacng/plugin.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/flacng/plugin.c	Mon Oct 08 02:02:02 2007 -0500
@@ -446,7 +446,7 @@
 
             _DEBUG("Copying %d samples to output plugin", sample_count);
 
-            produce_audio(flac_ip.output->written_time(), FMT_S16_NE, main_info->frame.channels, sample_count * sizeof(gint16), play_buffer, NULL);
+            playback->pass_audio(playback, FMT_S16_NE, main_info->frame.channels, sample_count * sizeof(gint16), play_buffer, NULL);
 
             read_pointer += sample_count;
             elements_left -= sample_count;
--- a/src/madplug/decoder.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/madplug/decoder.c	Mon Oct 08 02:02:02 2007 -0500
@@ -155,7 +155,7 @@
     assert(pos == olen);
     if (!info->playback->playing)
         return;
-    produce_audio(info->playback->output->written_time(),
+    info->playback->pass_audio(info->playback,
                   FMT_S16_LE, MAD_NCHANNELS(header), olen, output, &(info->playback->playing));
     if (!info->playback->playing)
         return;
--- a/src/metronom/metronom.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/metronom/metronom.c	Mon Oct 08 02:02:02 2007 -0500
@@ -148,10 +148,8 @@
 			datagoal=(datamiddle+7*datagoal)/8;
 			t++;
 		}
-		while(playback->output->buffer_free() < BUF_BYTES && going)
-			g_usleep(30000);
 		if (going)
-			produce_audio(playback->output->written_time(), FMT_S16_LE, 1, BUF_BYTES, data, &going);
+			playback->pass_audio(playback, FMT_S16_LE, 1, BUF_BYTES, data, &going);
 	}
 	/* Make sure the output plugin stops prebuffering */
 	playback->output->buffer_free();
--- a/src/modplug/modplugbmp.cxx	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/modplug/modplugbmp.cxx	Mon Oct 08 02:02:02 2007 -0500
@@ -242,7 +242,7 @@
 	return false;
 }
 
-void ModplugXMMS::PlayLoop()
+void ModplugXMMS::PlayLoop(InputPlayback *playback)
 {
 	uint32 lLength;
 	//the user might change the number of channels while playing.
@@ -303,9 +303,9 @@
 		if(mStopped)
 			break;
 		
-		produce_audio
+		playback->pass_audio
 		(
-			mPlayed,
+			playback,
 			mFormat,
 			lChannels,
 			mBufSize,
@@ -452,7 +452,7 @@
 
 	mDecodeThread = g_thread_self();
 	ipb->set_pb_ready(ipb);
-	this->PlayLoop();
+	this->PlayLoop(ipb);
 }
 
 void ModplugXMMS::Stop(void)
--- a/src/modplug/modplugbmp.h	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/modplug/modplugbmp.h	Mon Oct 08 02:02:02 2007 -0500
@@ -130,7 +130,7 @@
 	
 	float mPreampFactor;
 
-	void PlayLoop();
+	void PlayLoop(InputPlayback *);
 	static void* PlayThread(void* arg);
 	const char* Bool2OnOff(bool aValue);
 };
--- a/src/musepack/libmpc.cxx	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/musepack/libmpc.cxx	Mon Oct 08 02:02:02 2007 -0500
@@ -841,7 +841,7 @@
         int iFree = MpcPlugin.output->buffer_free();
         if (!mpcDecoder.isPause &&  iFree >= ((1152 * 4) << iPlaying))
         {
-            unsigned status = processBuffer(sampleBuffer, xmmsBuffer, decoder);
+            unsigned status = processBuffer(data, sampleBuffer, xmmsBuffer, decoder);
             if (status == (unsigned) (-1))
             {
                 mpcDecoder.isError = g_strdup_printf("[xmms-musepack] error from internal decoder on %s", filename);
@@ -871,7 +871,8 @@
     return endThread(filename, input, false);
 }
 
-static int processBuffer(MPC_SAMPLE_FORMAT* sampleBuffer, char* xmmsBuffer, mpc_decoder& decoder)
+static int processBuffer(InputPlayback *playback, 
+    MPC_SAMPLE_FORMAT* sampleBuffer, char* xmmsBuffer, mpc_decoder& decoder)
 {
     mpc_uint32_t vbrAcc = 0;
     mpc_uint32_t vbrUpd = 0;
@@ -884,7 +885,7 @@
         track.bitrate = static_cast<int> (vbrUpd * track.sampleFreq / 1152);
     }
 
-    produce_audio(MpcPlugin.output->written_time(), FMT_S16_LE, track.channels, status * 4, xmmsBuffer, NULL);
+    playback->pass_audio(playback, FMT_S16_LE, track.channels, status * 4, xmmsBuffer, NULL);
     return status;
 }
 
--- a/src/sexypsf/plugin.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/sexypsf/plugin.c	Mon Oct 08 02:02:02 2007 -0500
@@ -60,13 +60,12 @@
     {
         int t = playback->output->buffer_free() & mask;
         if (t > count)     
-            produce_audio(playback->output->written_time(),
+            playback->pass_audio(playback,
                           FMT_S16_NE, 2, count, buffer, NULL);
         else
         {
             if (t)
-                produce_audio(playback->output->written_time(),
-                              FMT_S16_NE, 2, t, buffer, NULL);
+                playback->pass_audio(playback, FMT_S16_NE, 2, t, buffer, NULL);
             g_usleep((count-t)*1000*5/441/2);
         }
         count -= t;
--- a/src/sid/xmms-sid.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/sid/xmms-sid.c	Mon Oct 08 02:02:02 2007 -0500
@@ -440,8 +440,7 @@
 		}
 
 		/* I <3 visualice/haujobb */
-		produce_audio(pb->output->written_time(),
-			xs_status.audioFormat, xs_status.audioChannels,
+		pb->pass_audio(pb, xs_status.audioFormat, xs_status.audioChannels,
 			audioGot, audioBuffer, NULL);
 		
 		XS_MUTEX_UNLOCK(xs_status);
--- a/src/timidity/xmms-timidity.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/timidity/xmms-timidity.c	Mon Oct 08 02:02:02 2007 -0500
@@ -261,7 +261,7 @@
 				buffer, buffer_size);
 
 		if (bytes_read != 0)
-			produce_audio(mid_song_get_time(xmmstimid_song),
+			playback->pass_audio(playback,
 					fmt, xmmstimid_opts.channels,
 					bytes_read, buffer, &playback->playing);
 		else {
--- a/src/tonegen/tonegen.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/tonegen/tonegen.c	Mon Oct 08 02:02:02 2007 -0500
@@ -114,9 +114,7 @@
 			data[i] = rint(((1 << 15) - 1) *
 				       (sum_sines / frequencies->len));
 		}
-		while (playback->output->buffer_free() < BUF_BYTES && going)
-		        g_usleep(30000);
-		produce_audio(playback->output->written_time(), FMT_S16_NE, 1, BUF_BYTES, data, &going);
+		playback->pass_audio(playback, FMT_S16_NE, 1, BUF_BYTES, data, &going);
 	}
 
 	g_array_free(frequencies, TRUE);
--- a/src/tta/libtta.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/tta/libtta.c	Mon Oct 08 02:02:02 2007 -0500
@@ -199,7 +199,7 @@
             }
             if (seek_position == -1)
             {
-                produce_audio(playback->output->written_time(),
+                playback->pass_audio(playback,
                               ((info.BPS == 8) ? FMT_U8 : FMT_S16_LE),
                               info.NCH,
                               read_samples * info.NCH * info.BSIZE,
--- a/src/vorbis/vorbis.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/vorbis/vorbis.c	Mon Oct 08 02:02:02 2007 -0500
@@ -395,8 +395,7 @@
     if (seekneeded != -1)
         do_seek(playback);
 
-    produce_audio(playback->output->written_time(),
-                  FMT_S16_NE, channels, bytes, pcmout, &playback->playing);
+    playback->pass_audio(playback, FMT_S16_NE, channels, bytes, pcmout, &playback->playing);
 
     return current_section;
 }
--- a/src/vtx/vtx.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/vtx/vtx.c	Mon Oct 08 02:02:02 2007 -0500
@@ -178,7 +178,7 @@
 	g_usleep(10000);
 
       if (playback->playing && seek_to == -1)
-        produce_audio(playback->output->written_time (), FMT_S16_NE,
+        playback->pass_audio(playback, FMT_S16_NE,
   			  chans , SNDBUFSIZE, sndbuf, &playback->playing);
     
       if (playback->eof)
--- a/src/wav/wav-sndfile.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/wav/wav-sndfile.c	Mon Oct 08 02:02:02 2007 -0500
@@ -372,7 +372,7 @@
 					break;	
 			}
 
-			produce_audio (playback->output->written_time (), FMT_S16_NE, sfinfo.channels, 
+			playback->pass_audio(playback, FMT_S16_NE, sfinfo.channels, 
 				samples * sizeof (short), buffer, &playback->playing);
 		}
 		else {
--- a/src/wav/wav.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/wav/wav.c	Mon Oct 08 02:02:02 2007 -0500
@@ -246,7 +246,7 @@
                     playback->eof = TRUE;
                 else {
                     if (wav_file->seek_to == -1)
-                        produce_audio(playback->output->written_time(),
+                        playback->pass_audio(playback,
                                       (wav_file->bits_per_sample ==
                                        16) ? FMT_S16_LE : FMT_U8,
                                       wav_file->channels, bytes, data,
--- a/src/wavpack/libwavpack.cxx	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/wavpack/libwavpack.cxx	Mon Oct 08 02:02:02 2007 -0500
@@ -254,13 +254,13 @@
         return mod->output->open_audio(FMT_S16_NE, sample_rate, num_channels);
     }
 
-    void process_buffer(size_t num_samples)
+    void process_buffer(InputPlayback *playback, size_t num_samples)
     {
         /* TODO: dithering */
         for (int i = 0; i < num_samples * num_channels; i++)
             output[i] = input[i];
 
-        produce_audio(mod->output->output_time(), FMT_S16_NE, 
+        playback->pass_audio(playback, FMT_S16_NE, 
 		num_channels, 
 		num_samples * num_channels * sizeof(int16_t),
 		output,
@@ -354,7 +354,7 @@
                 break;
             }
             else {
-                d.process_buffer(status);
+                d.process_buffer(playback, status);
             }
         }
         else {
--- a/src/wma/wma.c	Sun Oct 07 18:22:16 2007 -0500
+++ b/src/wma/wma.c	Mon Oct 08 02:02:02 2007 -0500
@@ -334,9 +334,8 @@
     {
         sst_buff = wma_st_buff;
 	if(wma_pause) memset(wma_s_outbuf, 0, sst_buff);	
-    	while(playback->output->buffer_free() < wma_st_buff) g_usleep(20000);
-	produce_audio(playback->output->written_time(), FMT_S16_NE,
-    			    c->channels, sst_buff, (short *)wma_s_outbuf, NULL);
+	playback->pass_audio(playback, FMT_S16_NE,
+            c->channels, sst_buff, (short *)wma_s_outbuf, NULL);
 	memset(wma_s_outbuf, 0, sst_buff);
     }
     fifo_free(&f);