changeset 1989:1bd99632fc4d

wavpack: set_params()
author William Pitcock <nenolod@atheme.org>
date Sun, 07 Oct 2007 14:44:46 -0500
parents 7cadca1a29ec
children c9e4ae9e1580
files src/wavpack/libwavpack.cxx
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/wavpack/libwavpack.cxx	Sun Oct 07 14:42:56 2007 -0500
+++ b/src/wavpack/libwavpack.cxx	Sun Oct 07 14:44:46 2007 -0500
@@ -223,11 +223,11 @@
         return true;
     }
 
-    bool attach_to_play(const char *filename)
+    bool attach_to_play(InputPlayback *playback)
     {
-        wv_Input = aud_vfs_fopen(filename, "rb");
+        wv_Input = aud_vfs_fopen(playback->filename, "rb");
 
-        char *corrFilename = g_strconcat(filename, "c", NULL);
+        char *corrFilename = g_strconcat(playback->filename, "c", NULL);
 
         wvc_Input = aud_vfs_fopen(corrFilename, "rb");
 
@@ -242,7 +242,7 @@
         num_channels = WavpackGetNumChannels(ctx);
         input = (int32_t *)calloc(BUFFER_SIZE, num_channels * sizeof(int32_t));
         output = (int16_t *)calloc(BUFFER_SIZE, num_channels * sizeof(int16_t));
-        mod->set_info(generate_title(filename, ctx),
+        playback->set_params(playback, generate_title(filename, ctx),
                       (int) (WavpackGetNumSamples(ctx) / sample_rate) * 1000,
                       (int) WavpackGetAverageBitrate(ctx, num_channels),
                       (int) sample_rate, num_channels);
@@ -303,16 +303,16 @@
 }
 
 static void *
-DecodeThread(void *a)
+DecodeThread(InputPlayback *playback)
 {
     ape_tag tag;
-    char *filename = (char *) a;
+    char *filename = playback->filename;
     int bps_updateCounter = 0;
     int bps;
     int i;
     WavpackDecoder d(&mod);
 
-    if (!d.attach_to_play(filename)) {
+    if (!d.attach_to_play(playback)) {
         killDecodeThread = true;
         return end_thread();
     }
@@ -373,7 +373,7 @@
     AudioError = false;
     thread_handle = g_thread_self();
     data->set_pb_ready(data);
-    DecodeThread((void *) data->filename);
+    DecodeThread(data);
     return;
 }