aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/aac_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-20 01:31:51 -0700
committerEric Wong <normalperson@yhbt.net>2008-08-20 01:31:51 -0700
commit1b197e65232e1a51b853db53985e8eda61f1b196 (patch)
tree2d85ff67ba79e32256a20d2d2bee7222352007fd /src/inputPlugins/aac_plugin.c
parent5a0216af3dc7c9dedc4dacb708191f0fd380bb73 (diff)
parent508ae1c18d3bdc99a1bb06181762e5ec859cf072 (diff)
downloadmpd-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/aac_plugin.c44
1 files changed, 14 insertions, 30 deletions
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c
index 6e53c6420..98329a4b3 100644
--- a/src/inputPlugins/aac_plugin.c
+++ b/src/inputPlugins/aac_plugin.c
@@ -339,9 +339,8 @@ static int aac_decode(char *path)
return -1;
}
- dc.audioFormat.bits = 16;
-
- dc.totalTime = totalTime;
+ dc.audio_format.bits = 16;
+ dc.total_time = totalTime;
file_time = 0.0;
@@ -372,13 +371,8 @@ static int aac_decode(char *path)
sampleRate = frameInfo.samplerate;
#endif
- if (dc.state != DECODE_STATE_DECODE) {
- dc.audioFormat.channels = frameInfo.channels;
- dc.audioFormat.sampleRate = sampleRate;
- getOutputAudioFormat(&(dc.audioFormat),
- &(ob.audioFormat));
- dc.state = DECODE_STATE_DECODE;
- }
+ dc.audio_format.channels = frameInfo.channels;
+ dc.audio_format.sampleRate = sampleRate;
advanceAacBuffer(&b, frameInfo.bytesconsumed);
@@ -395,34 +389,24 @@ static int aac_decode(char *path)
sampleBufferLen = sampleCount * 2;
- ob_send(NULL, 0, sampleBuffer,
- sampleBufferLen, file_time,
- bitRate, NULL);
- if (dc.seek) {
- dc.seekError = 1;
- dc.seek = 0;
- decoder_wakeup_player();
- } else if (dc.stop) {
- eof = 1;
+ switch (ob_send(sampleBuffer, sampleBufferLen,
+ file_time, bitRate, NULL)) {
+ case DC_ACTION_NONE: break;
+ case DC_ACTION_SEEK:
+ /*
+ * this plugin doesn't support seek because nobody
+ * has bothered, yet...
+ */
+ dc_action_seek_fail(DC_SEEK_ERROR);
break;
+ default: eof = 1;
}
}
- ob_flush();
-
faacDecClose(decoder);
if (b.buffer)
free(b.buffer);
- if (dc.state != DECODE_STATE_DECODE)
- return -1;
-
- if (dc.seek) {
- dc.seekError = 1;
- dc.seek = 0;
- decoder_wakeup_player();
- }
-
return 0;
}