# HG changeset patch # User chainsaw # Date 1180046785 25200 # Node ID 0847931f52b78772592184f292fd4a071681d019 # Parent c77a0ed314bc869e0616fdc601f86664602187a2 [svn] Port to plugin API v2. diff -r c77a0ed314bc -r 0847931f52b7 ChangeLog --- a/ChangeLog Thu May 24 15:21:11 2007 -0700 +++ b/ChangeLog Thu May 24 15:46:25 2007 -0700 @@ -1,3 +1,10 @@ +2007-05-24 22:21:11 +0000 Tony Vroon + revision [2312] + Port to plugin API v2. + trunk/src/aac/src/libmp4.c | 61 ++++++++++++++++----------------------------- + 1 file changed, 23 insertions(+), 38 deletions(-) + + 2007-05-24 21:54:58 +0000 Tony Vroon revision [2310] Port to plugin API v2. diff -r c77a0ed314bc -r 0847931f52b7 src/alac/plugin.c --- a/src/alac/plugin.c Thu May 24 15:21:11 2007 -0700 +++ b/src/alac/plugin.c Thu May 24 15:46:25 2007 -0700 @@ -91,11 +91,6 @@ &aboutbox); } -static void alac_init(void) -{ - /* empty */ -} - gboolean is_our_fd(char *filename, VFSFile* input_file) { demux_res_t demux_res; @@ -213,40 +208,6 @@ return -1; } -gchar *alac_fmts[] = { "m4a", "alac", NULL }; - -InputPlugin alac_ip = { - NULL, - NULL, - "Apple Lossless Plugin", /* Description */ - alac_init, - alac_about, - NULL, - NULL, - NULL, - play_file, - stop, - do_pause, - seek, - NULL, - get_time, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, /* file_info_box */ - NULL, - build_tuple, - NULL, - NULL, - is_our_fd, - alac_fmts -}; - static int get_sample_info(demux_res_t *demux_res, uint32_t samplenum, uint32_t *sample_duration, uint32_t *sample_byte_size) @@ -336,6 +297,26 @@ free(pDestBuffer); } +static gchar *fmts[] = { "m4a", "alac", NULL }; + +InputPlugin alac_ip = { + .description = "Apple Lossless Plugin", + .about = alac_about, + .play_file = play_file, + .stop = stop, + .pause = do_pause, + .seek = seek, + .get_song_tuple = build_tuple, + .is_our_file_from_vfs = is_our_fd, + .vfs_extensions = fmts, +}; + +InputPlugin *alac_iplist[] = { &alac_ip, NULL }; + +DECLARE_PLUGIN(alac, NULL, NULL, alac_iplist, NULL, NULL, NULL, NULL); + +InputPlugin *alac_plugin = &alac_ip; + gpointer decode_thread(void *args) { demux_res_t demux_res; @@ -377,7 +358,7 @@ (float)(demux_res.sample_rate / 251)); 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); + alac_plugin->set_info(title, duration, -1, demux_res.sample_rate, demux_res.num_channels); /* will convert the entire buffer */ GetBuffer(&demux_res); @@ -393,8 +374,3 @@ return NULL; } - -InputPlugin *get_iplugin_info(void) -{ - return &alac_ip; -}