diff src/alac/plugin.c @ 561:914c96de3244 trunk

[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
author iabervon
date Sun, 28 Jan 2007 21:09:12 -0800
parents d5782f3bd760
children 0847931f52b7
line wrap: on
line diff
--- a/src/alac/plugin.c	Sun Jan 28 17:41:50 2007 -0800
+++ b/src/alac/plugin.c	Sun Jan 28 21:09:12 2007 -0800
@@ -178,10 +178,13 @@
     return build_tuple_from_demux(&demux_res, filename);
 }
 
+static InputPlayback *playback;
+
 static void play_file(InputPlayback *data)
 {
     char *filename = data->filename;
     going = 1;
+    playback = data;
     playback_thread = g_thread_create(decode_thread, filename, TRUE, NULL);
 }
 
@@ -326,7 +329,7 @@
         /* write */
         bytes_read += outputBytes;
 
-        produce_audio(alac_ip.output->written_time(), FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
+        produce_audio(playback->output->written_time(), FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
     }
 
     free(buffer);
@@ -373,7 +376,7 @@
     duration = (demux_res.num_sample_byte_sizes * (float)((1024 * demux_res.sample_size) - 1.0) /
 	(float)(demux_res.sample_rate / 251));
 
-    alac_ip.output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
+    playback->output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
     alac_ip.set_info(title, duration, -1, demux_res.sample_rate, demux_res.num_channels);
 
     /* will convert the entire buffer */
@@ -386,7 +389,7 @@
     if (input_opened)
         vfs_fclose(input_file);
 
-    alac_ip.output->close_audio();
+    playback->output->close_audio();
 
     return NULL;
 }