diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-08-20 01:31:51 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-20 01:31:51 -0700 |
commit | 1b197e65232e1a51b853db53985e8eda61f1b196 (patch) | |
tree | 2d85ff67ba79e32256a20d2d2bee7222352007fd /src/inputPlugins/mod_plugin.c | |
parent | 5a0216af3dc7c9dedc4dacb708191f0fd380bb73 (diff) | |
parent | 508ae1c18d3bdc99a1bb06181762e5ec859cf072 (diff) | |
download | mpd-1b197e65232e1a51b853db53985e8eda61f1b196.tar.gz mpd-1b197e65232e1a51b853db53985e8eda61f1b196.tar.xz mpd-1b197e65232e1a51b853db53985e8eda61f1b196.zip |
Merge branch 'core-rewrite' of git://git.musicpd.org/normalperson/mpd
* 'core-rewrite' of git://git.musicpd.org/normalperson/mpd:
Remove ob_wait_sync and cleanup triggering in playlist
fix output buffer deadlock when daemonizing
log.c: thread-safety for warning log
core rewrite (decode,player,outputBuffer,playlist)
Diffstat (limited to '')
-rw-r--r-- | src/inputPlugins/mod_plugin.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c index 23b16fa23..9f9da6273 100644 --- a/src/inputPlugins/mod_plugin.c +++ b/src/inputPlugins/mod_plugin.c @@ -24,7 +24,6 @@ #include "../audio.h" #include "../log.h" #include "../pcm_utils.h" -#include "../playerData.h" #include "../os_compat.h" #include <mikmod.h> @@ -179,25 +178,20 @@ static int mod_decode(char *path) return -1; } - dc.totalTime = 0; - dc.audioFormat.bits = 16; - dc.audioFormat.sampleRate = 44100; - dc.audioFormat.channels = 2; - getOutputAudioFormat(&(dc.audioFormat), &(ob.audioFormat)); + dc.total_time = 0; + dc.audio_format.bits = 16; + dc.audio_format.sampleRate = 44100; + dc.audio_format.channels = 2; secPerByte = - 1.0 / ((dc.audioFormat.bits * dc.audioFormat.channels / 8.0) * - (float)dc.audioFormat.sampleRate); + 1.0 / ((dc.audio_format.bits * dc.audio_format.channels / 8.0) * + (float)dc.audio_format.sampleRate); - dc.state = DECODE_STATE_DECODE; while (1) { - if (dc.seek) { - dc.seekError = 1; - dc.seek = 0; - decoder_wakeup_player(); - } + if (dc_seek()) + dc_action_seek_fail(DC_SEEK_ERROR); - if (dc.stop) + if (dc_intr()) break; if (!Player_Active()) @@ -205,13 +199,8 @@ static int mod_decode(char *path) ret = VC_WriteBytes(data->audio_buffer, MIKMOD_FRAME_SIZE); total_time += ret * secPerByte; - ob_send(NULL, 0, - (char *)data->audio_buffer, ret, - total_time, 0, NULL); + ob_send((char *)data->audio_buffer, ret, total_time, 0, NULL); } - - ob_flush(); - mod_close(data); MikMod_Exit(); |