diff options
author | waker <wakeroid@gmail.com> | 2010-11-28 18:14:47 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-11-28 18:14:47 +0100 |
commit | 0c23a5d82d6f37c29dcbd65d0a4ce40c7abeb998 (patch) | |
tree | dc210a2aaf673eed46cff992f2d138e227382f0a /plugins/nullout | |
parent | 0cf1d57bc3dab11f773d23a25db0c3d18f6cfe52 (diff) |
fixed dsp reset; ported nullout plugin to new api; fixed output plugin switching
Diffstat (limited to 'plugins/nullout')
-rw-r--r-- | plugins/nullout/nullout.c | 47 |
1 files changed, 7 insertions, 40 deletions
diff --git a/plugins/nullout/nullout.c b/plugins/nullout/nullout.c index 9df5d9d5..627f8a98 100644 --- a/plugins/nullout/nullout.c +++ b/plugins/nullout/nullout.c @@ -32,7 +32,6 @@ DB_functions_t *deadbeef; static intptr_t null_tid; static int null_terminate; -static int null_rate; static int state; static void @@ -47,8 +46,8 @@ pnull_init (void); static int pnull_free (void); -static int -pnull_change_rate (int rate); +void +pnull_setformat (ddb_waveformat_t *fmt); static int pnull_play (void); @@ -62,32 +61,18 @@ pnull_pause (void); static int pnull_unpause (void); -static int -pnull_get_rate (void); - -static int -pnull_get_bps (void); - -static int -pnull_get_channels (void); - -static int -pnull_get_endianness (void); - int pnull_init (void) { trace ("pnull_init\n"); state = OUTPUT_STATE_STOPPED; - null_rate = 44100; null_terminate = 0; null_tid = deadbeef->thread_start (pnull_thread, NULL); return 0; } -int -pnull_change_rate (int rate) { - null_rate = rate; - return null_rate; +void +pnull_setformat (ddb_waveformat_t *fmt) { + memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t)); } int @@ -140,21 +125,6 @@ pnull_unpause (void) { return 0; } -int -pnull_get_rate (void) { - return null_rate; -} - -int -pnull_get_bps (void) { - return 16; -} - -int -pnull_get_channels (void) { - return 2; -} - static int pnull_get_endianness (void) { #if WORDS_BIGENDIAN @@ -233,14 +203,11 @@ static DB_output_t plugin = { .plugin.stop = null_stop, .init = pnull_init, .free = pnull_free, - .change_rate = pnull_change_rate, + .setformat = pnull_setformat, .play = pnull_play, .stop = pnull_stop, .pause = pnull_pause, .unpause = pnull_unpause, .state = pnull_get_state, - .samplerate = pnull_get_rate, - .bitspersample = pnull_get_bps, - .channels = pnull_get_channels, - .endianness = pnull_get_endianness, + .fmt = {.samplerate = 44100, .channels = 2, .bps = 16, .channelmask = DDB_SPEAKER_FRONT_LEFT | DDB_SPEAKER_FRONT_RIGHT} }; |