aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/_flac_common.c2
-rw-r--r--src/inputPlugins/aac_plugin.c6
-rw-r--r--src/inputPlugins/audiofile_plugin.c4
-rw-r--r--src/inputPlugins/flac_plugin.c12
-rw-r--r--src/inputPlugins/mod_plugin.c4
-rw-r--r--src/inputPlugins/mp3_plugin.c40
-rw-r--r--src/inputPlugins/mp4_plugin.c6
-rw-r--r--src/inputPlugins/mpc_plugin.c19
-rw-r--r--src/inputPlugins/oggflac_plugin.c13
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c14
-rw-r--r--src/inputPlugins/wavpack_plugin.c6
11 files changed, 67 insertions, 59 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c
index 1cf094651..613c84154 100644
--- a/src/inputPlugins/_flac_common.c
+++ b/src/inputPlugins/_flac_common.c
@@ -178,7 +178,7 @@ void flac_error_common_cb(const char *plugin,
const FLAC__StreamDecoderErrorStatus status,
mpd_unused FlacData * data)
{
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(data->decoder) == DECODE_COMMAND_STOP)
return;
switch (status) {
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c
index c8445250e..29cb23db0 100644
--- a/src/inputPlugins/aac_plugin.c
+++ b/src/inputPlugins/aac_plugin.c
@@ -389,10 +389,10 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
decoder_data(mpd_decoder, NULL, 0, sampleBuffer,
sampleBufferLen, file_time,
bitRate, NULL);
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
dc.seekError = 1;
dc_command_finished();
- } else if (dc.command == DECODE_COMMAND_STOP)
+ } else if (decoder_get_command(decoder) == DECODE_COMMAND_STOP)
break;
}
@@ -405,7 +405,7 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
if (dc.state != DECODE_STATE_DECODE)
return -1;
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
dc.seekError = 1;
dc_command_finished();
}
diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c
index 6b8e4e2bd..c75c189c7 100644
--- a/src/inputPlugins/audiofile_plugin.c
+++ b/src/inputPlugins/audiofile_plugin.c
@@ -90,7 +90,7 @@ static int audiofile_decode(struct decoder * decoder, char *path)
decoder_initialized(decoder, &audio_format, total_time);
do {
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
decoder_clear(decoder);
current = dc.seekWhere *
audio_format.sampleRate;
@@ -108,7 +108,7 @@ static int audiofile_decode(struct decoder * decoder, char *path)
chunk, ret * fs,
(float)current / (float)audio_format.sampleRate,
bitRate, NULL);
- } while (dc.command != DECODE_COMMAND_STOP);
+ } while (decoder_get_command(decoder) != DECODE_COMMAND_STOP);
decoder_flush(decoder);
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index 890c78fa3..fd6ab4e2f 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -37,14 +37,14 @@ static flac_read_status flacRead(mpd_unused const flac_decoder * flacDec,
while (1) {
r = readFromInputStream(data->inStream, (void *)buf, 1, *bytes);
if (r == 0 && !inputStreamAtEOF(data->inStream) &&
- dc.command != DECODE_COMMAND_STOP)
+ decoder_get_command(data->decoder) != DECODE_COMMAND_STOP)
my_usleep(10000);
else
break;
}
*bytes = r;
- if (r == 0 && dc.command != DECODE_COMMAND_STOP) {
+ if (r == 0 && decoder_get_command(data->decoder) != DECODE_COMMAND_STOP) {
if (inputStreamAtEOF(data->inStream))
return flac_read_status_eof;
else
@@ -287,7 +287,7 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
data->chunk_length = 0;
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(data->decoder) == DECODE_COMMAND_SEEK) {
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -423,7 +423,7 @@ static int flac_decode_internal(struct decoder * decoder,
break;
if (flac_get_state(flacDec) == flac_decoder_eof)
break;
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
FLAC__uint64 sampleToSeek = dc.seekWhere *
data.audio_format.sampleRate + 0.5;
if (flac_seek_absolute(flacDec, sampleToSeek)) {
@@ -436,12 +436,12 @@ static int flac_decode_internal(struct decoder * decoder,
dc_command_finished();
}
}
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) {
flacPrintErroredState(flac_get_state(flacDec));
flac_finish(flacDec);
}
/* send last little bit */
- if (data.chunk_length > 0 && dc.command != DECODE_COMMAND_STOP) {
+ if (data.chunk_length > 0 && decoder_get_command(decoder) != DECODE_COMMAND_STOP) {
flacSendChunk(&data);
decoder_flush(decoder);
}
diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c
index 179dc707c..9f972ed15 100644
--- a/src/inputPlugins/mod_plugin.c
+++ b/src/inputPlugins/mod_plugin.c
@@ -187,12 +187,12 @@ static int mod_decode(struct decoder * decoder, char *path)
decoder_initialized(decoder, &audio_format, 0);
while (1) {
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
dc.seekError = 1;
dc_command_finished();
}
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(decoder) == DECODE_COMMAND_STOP)
break;
if (!Player_Active())
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index dfd6ef038..e1262fa6d 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -669,7 +669,7 @@ static int parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen)
return 1;
}
-static int decodeFirstFrame(mp3DecodeData * data,
+static int decodeFirstFrame(mp3DecodeData * data, struct decoder * decoder,
MpdTag ** tag, ReplayGainInfo ** replayGainInfo)
{
struct xing xing;
@@ -684,16 +684,16 @@ static int decodeFirstFrame(mp3DecodeData * data,
while (1) {
while ((ret = decodeNextFrameHeader(data, tag, replayGainInfo)) == DECODE_CONT &&
- dc.command != DECODE_COMMAND_STOP);
+ (!decoder || decoder_get_command(decoder) != DECODE_COMMAND_STOP));
if (ret == DECODE_BREAK ||
- (dc.command == DECODE_COMMAND_STOP))
+ (decoder && decoder_get_command(decoder) == DECODE_COMMAND_STOP))
return -1;
if (ret == DECODE_SKIP) continue;
while ((ret = decodeNextFrame(data)) == DECODE_CONT &&
- dc.command != DECODE_COMMAND_STOP);
+ (!decoder || decoder_get_command(decoder) != DECODE_COMMAND_STOP));
if (ret == DECODE_BREAK ||
- (dc.command == DECODE_COMMAND_STOP))
+ (decoder && decoder_get_command(decoder) == DECODE_COMMAND_STOP))
return -1;
if (ret == DECODE_OK) break;
}
@@ -786,7 +786,7 @@ static int getMp3TotalTime(char *file)
if (openInputStream(&inStream, file) < 0)
return -1;
initMp3DecodeData(&data, &inStream);
- if (decodeFirstFrame(&data, NULL, NULL) < 0)
+ if (decodeFirstFrame(&data, NULL, NULL, NULL) < 0)
ret = -1;
else
ret = data.totalTime + 0.5;
@@ -797,12 +797,12 @@ static int getMp3TotalTime(char *file)
}
static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
- MpdTag ** tag,
+ struct decoder * decoder, MpdTag ** tag,
ReplayGainInfo ** replayGainInfo)
{
initMp3DecodeData(data, inStream);
*tag = NULL;
- if (decodeFirstFrame(data, tag, replayGainInfo) < 0) {
+ if (decodeFirstFrame(data, decoder, tag, replayGainInfo) < 0) {
mp3DecodeDataFinalize(data);
if (tag && *tag)
freeMpdTag(*tag);
@@ -948,7 +948,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
data->decodedFirstFrame = 1;
- if (dc.command == DECODE_COMMAND_SEEK &&
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK &&
data->inStream->seekable) {
long j = 0;
data->muteFrame = MUTEFRAME_SEEK;
@@ -970,7 +970,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
data->muteFrame = 0;
dc_command_finished();
}
- } else if (dc.command == DECODE_COMMAND_SEEK &&
+ } else if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK &&
!data->inStream->seekable) {
dc.seekError = 1;
dc_command_finished();
@@ -982,23 +982,23 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
while ((ret =
decodeNextFrameHeader(data, NULL,
replayGainInfo)) == DECODE_CONT
- && dc.command != DECODE_COMMAND_STOP) ;
- if (ret == DECODE_BREAK || dc.command != DECODE_COMMAND_NONE)
+ && decoder_get_command(decoder) != DECODE_COMMAND_STOP) ;
+ if (ret == DECODE_BREAK || decoder_get_command(decoder) != DECODE_COMMAND_NONE)
break;
else if (ret == DECODE_SKIP)
skip = 1;
if (!data->muteFrame) {
while ((ret = decodeNextFrame(data)) == DECODE_CONT &&
- dc.command == DECODE_COMMAND_NONE) ;
+ decoder_get_command(decoder) == DECODE_COMMAND_NONE) ;
if (ret == DECODE_BREAK ||
- dc.command != DECODE_COMMAND_NONE)
+ decoder_get_command(decoder) != DECODE_COMMAND_NONE)
break;
}
if (!skip && ret == DECODE_OK)
break;
}
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(decoder) == DECODE_COMMAND_STOP)
return DECODE_BREAK;
return ret;
@@ -1019,9 +1019,9 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
ReplayGainInfo *replayGainInfo = NULL;
AudioFormat audio_format;
- if (openMp3FromInputStream(inStream, &data, &tag, &replayGainInfo) <
- 0) {
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (openMp3FromInputStream(inStream, &data, decoder,
+ &tag, &replayGainInfo) < 0) {
+ if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) {
ERROR
("Input does not appear to be a mp3 bit stream.\n");
return -1;
@@ -1060,7 +1060,7 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
while (mp3Read(&data, decoder, &replayGainInfo) != DECODE_BREAK) ;
/* send last little bit if not DECODE_COMMAND_STOP */
- if (dc.command != DECODE_COMMAND_STOP &&
+ if (decoder_get_command(decoder) != DECODE_COMMAND_STOP &&
data.outputPtr != data.outputBuffer && data.flush) {
decoder_data(decoder, NULL,
data.inStream->seekable,
@@ -1073,7 +1073,7 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
if (replayGainInfo)
freeReplayGainInfo(replayGainInfo);
- if (dc.command == DECODE_COMMAND_SEEK &&
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK &&
data.muteFrame == MUTEFRAME_SEEK) {
decoder_clear(decoder);
dc_command_finished();
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index 4ffe4658f..91bf68e02 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -178,7 +178,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
seekTable = xmalloc(sizeof(float) * numSamples);
for (sampleId = 0; sampleId < numSamples; sampleId++) {
- if (dc.command == DECODE_COMMAND_SEEK)
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK)
seeking = 1;
if (seeking && seekTableEnd > 1 &&
@@ -270,7 +270,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
decoder_data(mpd_decoder, inStream, 1, sampleBuffer,
sampleBufferLen, file_time,
bitRate, NULL);
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
break;
}
@@ -282,7 +282,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
if (dc.state != DECODE_STATE_DECODE)
return -1;
- if (dc.command == DECODE_COMMAND_SEEK && seeking) {
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK && seeking) {
decoder_clear(mpd_decoder);
dc_command_finished();
}
diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c
index 399adf972..ff378fe7b 100644
--- a/src/inputPlugins/mpc_plugin.c
+++ b/src/inputPlugins/mpc_plugin.c
@@ -27,6 +27,7 @@
typedef struct _MpcCallbackData {
InputStream *inStream;
+ struct decoder *decoder;
} MpcCallbackData;
static mpc_int32_t mpc_read_cb(void *vdata, void *ptr, mpc_int32_t size)
@@ -37,7 +38,8 @@ static mpc_int32_t mpc_read_cb(void *vdata, void *ptr, mpc_int32_t size)
while (1) {
ret = readFromInputStream(data->inStream, ptr, 1, size);
if (ret == 0 && !inputStreamAtEOF(data->inStream) &&
- (dc.command != DECODE_COMMAND_STOP))
+ (data->decoder &&
+ decoder_get_command(data->decoder) != DECODE_COMMAND_STOP))
my_usleep(10000);
else
break;
@@ -132,6 +134,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
ReplayGainInfo *replayGainInfo = NULL;
data.inStream = inStream;
+ data.decoder = mpd_decoder;
reader.read = mpc_read_cb;
reader.seek = mpc_seek_cb;
@@ -143,7 +146,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
mpc_streaminfo_init(&info);
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
ERROR("Not a valid musepack stream\n");
return -1;
}
@@ -153,7 +156,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
mpc_decoder_setup(&decoder, &reader);
if (!mpc_decoder_initialize(&decoder, &info)) {
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
ERROR("Not a valid musepack stream\n");
return -1;
}
@@ -174,7 +177,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
mpc_streaminfo_get_length(&info));
while (!eof) {
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
samplePos = dc.seekWhere * audio_format.sampleRate;
if (mpc_decoder_seek_sample(&decoder, samplePos)) {
decoder_clear(mpd_decoder);
@@ -190,7 +193,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
ret = mpc_decoder_decode(&decoder, sample_buffer,
&vbrUpdateAcc, &vbrUpdateBits);
- if (ret <= 0 || dc.command == DECODE_COMMAND_STOP) {
+ if (ret <= 0 || decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
eof = 1;
break;
}
@@ -221,7 +224,7 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
chunkpos = 0;
s16 = (mpd_sint16 *) chunk;
- if (dc.command == DECODE_COMMAND_STOP) {
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
eof = 1;
break;
}
@@ -229,7 +232,8 @@ static int mpc_decode(struct decoder * mpd_decoder, InputStream * inStream)
}
}
- if (dc.command != DECODE_COMMAND_STOP && chunkpos > 0) {
+ if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP &&
+ chunkpos > 0) {
total_time = ((float)samplePos) / audio_format.sampleRate;
bitRate =
@@ -257,6 +261,7 @@ static float mpcGetTime(char *file)
MpcCallbackData data;
data.inStream = &inStream;
+ data.decoder = NULL;
reader.read = mpc_read_cb;
reader.seek = mpc_seek_cb;
diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c
index f8cb4c09a..09a514194 100644
--- a/src/inputPlugins/oggflac_plugin.c
+++ b/src/inputPlugins/oggflac_plugin.c
@@ -50,7 +50,7 @@ static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
while (1) {
r = readFromInputStream(data->inStream, (void *)buf, 1, *bytes);
if (r == 0 && !inputStreamAtEOF(data->inStream) &&
- dc.command != DECODE_COMMAND_STOP)
+ decoder_get_command(data->decoder) != DECODE_COMMAND_STOP)
my_usleep(10000);
else
break;
@@ -58,7 +58,7 @@ static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
*bytes = r;
if (r == 0 && !inputStreamAtEOF(data->inStream) &&
- dc.command != DECODE_COMMAND_STOP)
+ decoder_get_command(data->decoder) != DECODE_COMMAND_STOP)
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
@@ -195,7 +195,7 @@ static FLAC__StreamDecoderWriteStatus oggflacWrite(const
FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
data->chunk_length = 0;
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(data->decoder) == DECODE_COMMAND_SEEK) {
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -353,7 +353,7 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
OggFLAC__SEEKABLE_STREAM_DECODER_OK) {
break;
}
- if (dc->command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
FLAC__uint64 sampleToSeek = dc->seekWhere *
data.audio_format.sampleRate + 0.5;
if (OggFLAC__seekable_stream_decoder_seek_absolute
@@ -368,13 +368,14 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
}
}
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
oggflacPrintErroredState
(OggFLAC__seekable_stream_decoder_get_state(decoder));
OggFLAC__seekable_stream_decoder_finish(decoder);
}
/* send last little bit */
- if (data.chunk_length > 0 && dc.command != DECODE_COMMAND_STOP) {
+ if (data.chunk_length > 0 &&
+ decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
flacSendChunk(&data);
decoder_flush(mpd_decoder);
}
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index e53e27de7..8e98bdf4e 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -50,6 +50,7 @@
typedef struct _OggCallbackData {
InputStream *inStream;
+ struct decoder *decoder;
} OggCallbackData;
static size_t ogg_read_cb(void *ptr, size_t size, size_t nmemb, void *vdata)
@@ -60,7 +61,7 @@ static size_t ogg_read_cb(void *ptr, size_t size, size_t nmemb, void *vdata)
while (1) {
ret = readFromInputStream(data->inStream, ptr, size, nmemb);
if (ret == 0 && !inputStreamAtEOF(data->inStream) &&
- dc.command != DECODE_COMMAND_STOP) {
+ decoder_get_command(data->decoder) != DECODE_COMMAND_STOP) {
my_usleep(10000);
} else
break;
@@ -74,7 +75,7 @@ static size_t ogg_read_cb(void *ptr, size_t size, size_t nmemb, void *vdata)
static int ogg_seek_cb(void *vdata, ogg_int64_t offset, int whence)
{
const OggCallbackData *data = (const OggCallbackData *) vdata;
- if(dc.command == DECODE_COMMAND_STOP)
+ if(decoder_get_command(data->decoder) == DECODE_COMMAND_STOP)
return -1;
return seekInputStream(data->inStream, offset, whence);
}
@@ -229,13 +230,14 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
const char *errorStr;
data.inStream = inStream;
+ data.decoder = decoder;
callbacks.read_func = ogg_read_cb;
callbacks.seek_func = ogg_seek_cb;
callbacks.close_func = ogg_close_cb;
callbacks.tell_func = ogg_tell_cb;
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
- if (dc.command != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) {
switch (ret) {
case OV_EREAD:
errorStr = "read error";
@@ -265,7 +267,7 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
audio_format.bits = 16;
while (1) {
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
if (0 == ov_time_seek_page(&vf, dc.seekWhere)) {
decoder_clear(decoder);
chunkpos = 0;
@@ -315,12 +317,12 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
ov_pcm_tell(&vf) / audio_format.sampleRate,
bitRate, replayGainInfo);
chunkpos = 0;
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(decoder) == DECODE_COMMAND_STOP)
break;
}
}
- if (dc.command != DECODE_COMMAND_STOP && chunkpos > 0) {
+ if (decoder_get_command(decoder) != DECODE_COMMAND_STOP && chunkpos > 0) {
decoder_data(decoder, NULL, inStream->seekable,
chunk, chunkpos,
ov_time_tell(&vf), bitRate,
diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c
index a74da7e30..926c9f710 100644
--- a/src/inputPlugins/wavpack_plugin.c
+++ b/src/inputPlugins/wavpack_plugin.c
@@ -172,7 +172,7 @@ static void wavpack_decode(struct decoder * decoder,
position = 0;
do {
- if (dc.command == DECODE_COMMAND_SEEK) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
if (canseek) {
int where;
@@ -191,7 +191,7 @@ static void wavpack_decode(struct decoder * decoder,
dc_command_finished();
}
- if (dc.command == DECODE_COMMAND_STOP)
+ if (decoder_get_command(decoder) == DECODE_COMMAND_STOP)
break;
samplesgot = WavpackUnpackSamples(wpc,
@@ -501,7 +501,7 @@ static int wavpack_streamdecode(struct decoder * decoder, InputStream *is)
break;
}
- if (dc.command == DECODE_COMMAND_STOP) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_STOP) {
break;
}