# HG changeset patch # User Christian Birchinger # Date 1186258028 -7200 # Node ID 48e73f07ec9b21ed6c1891f2f6531b1a35a3460c # Parent ab7d89bb8fcb71e63b6726b00f9787fdf1d80948 Use configured core sample rate frequency if available. diff -r ab7d89bb8fcb -r 48e73f07ec9b src/vtx/vtx.c --- a/src/vtx/vtx.c Sat Aug 04 21:37:11 2007 +0200 +++ b/src/vtx/vtx.c Sat Aug 04 22:07:08 2007 +0200 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,19 @@ static gchar *vtx_fmts[] = { "vtx", NULL }; +void +vtx_init(void) +{ + ConfigDb *db; + db = bmp_cfg_db_open(); + + bmp_cfg_db_get_int(db, NULL, "src_rate", &freq); + if (freq < 4000 || freq > 192000) + freq = 44100; + + bmp_cfg_db_close(db); +} + int vtx_is_our_fd (char *filename, VFSFile *fp) { @@ -293,8 +307,8 @@ InputPlugin vtx_ip = { NULL, /* FILLED BY XMMS */ NULL, /* FILLED BY XMMS */ - "VTX Audio Plugin", /* Plugin description */ - NULL, /* Initialization */ + "VTX Audio Plugin", /* Plugin description */ + vtx_init, /* Initialization */ vtx_about, /* Show aboutbox */ vtx_config, /* Show/edit configuration */ vtx_is_our_file, /* Check file, return 1 if the plugin can handle this file */ @@ -323,4 +337,4 @@ InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; -DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL, NULL); +DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL); diff -r ab7d89bb8fcb -r 48e73f07ec9b src/vtx/vtx.h --- a/src/vtx/vtx.h Sat Aug 04 21:37:11 2007 +0200 +++ b/src/vtx/vtx.h Sat Aug 04 22:07:08 2007 +0200 @@ -13,6 +13,7 @@ #include "audacious/plugin.h" +void vtx_init(void); void vtx_about(void); void vtx_config(void); void vtx_file_info(char *filename);