Simplify decode cleanup logic a bit
DECODE_STATE_STOP is always set as dc->state, and dc->stop is always cleared. So handle it in decodeStart once rather than doing it in every plugin. While we're at it, fix a long-standing (but difficult to trigger) bug in mpc_decode where we failed to return if mpc_decoder_initialize() fails. git-svn-id: https://svn.musicpd.org/mpd/trunk@7122 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
41
src/decode.c
41
src/decode.c
@@ -278,6 +278,7 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
DecoderControl * dc)
|
DecoderControl * dc)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
int close_instream = 1;
|
||||||
InputStream inStream;
|
InputStream inStream;
|
||||||
InputPlugin *plugin = NULL;
|
InputPlugin *plugin = NULL;
|
||||||
char path_max_tmp[MPD_PATH_MAX];
|
char path_max_tmp[MPD_PATH_MAX];
|
||||||
@@ -286,9 +287,7 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
if (isRemoteUrl(pc->utf8url)) {
|
if (isRemoteUrl(pc->utf8url)) {
|
||||||
if (!utf8_to_latin1(path_max_tmp, pc->utf8url)) {
|
if (!utf8_to_latin1(path_max_tmp, pc->utf8url)) {
|
||||||
dc->error = DECODE_ERROR_FILE;
|
dc->error = DECODE_ERROR_FILE;
|
||||||
dc->state = DECODE_STATE_STOP;
|
goto stop_no_close;
|
||||||
dc->start = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
rmp2amp_r(path_max_tmp,
|
rmp2amp_r(path_max_tmp,
|
||||||
@@ -300,9 +299,7 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
|
|
||||||
if (openInputStream(&inStream, path_max_tmp) < 0) {
|
if (openInputStream(&inStream, path_max_tmp) < 0) {
|
||||||
dc->error = DECODE_ERROR_FILE;
|
dc->error = DECODE_ERROR_FILE;
|
||||||
dc->state = DECODE_STATE_STOP;
|
goto stop_no_close;
|
||||||
dc->start = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dc->state = DECODE_STATE_START;
|
dc->state = DECODE_STATE_START;
|
||||||
@@ -317,20 +314,8 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
/* for http streams, seekable is determined in bufferInputStream */
|
/* for http streams, seekable is determined in bufferInputStream */
|
||||||
dc->seekable = inStream.seekable;
|
dc->seekable = inStream.seekable;
|
||||||
|
|
||||||
if (dc->stop) {
|
if (dc->stop)
|
||||||
dc->state = DECODE_STATE_STOP;
|
goto stop;
|
||||||
dc->stop = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if(inStream.metaName) {
|
|
||||||
MpdTag * tag = newMpdTag();
|
|
||||||
tag->name = xstrdup(inStream.metaName);
|
|
||||||
copyMpdTagToOutputBuffer(cb, tag);
|
|
||||||
freeMpdTag(tag);
|
|
||||||
} */
|
|
||||||
|
|
||||||
/* reset Metadata in OutputBuffer */
|
|
||||||
|
|
||||||
ret = DECODE_ERROR_UNKTYPE;
|
ret = DECODE_ERROR_UNKTYPE;
|
||||||
if (isRemoteUrl(dc->utf8url)) {
|
if (isRemoteUrl(dc->utf8url)) {
|
||||||
@@ -390,6 +375,7 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
|
|
||||||
if (plugin->fileDecodeFunc) {
|
if (plugin->fileDecodeFunc) {
|
||||||
closeInputStream(&inStream);
|
closeInputStream(&inStream);
|
||||||
|
close_instream = 0;
|
||||||
ret = plugin->fileDecodeFunc(cb, dc,
|
ret = plugin->fileDecodeFunc(cb, dc,
|
||||||
path_max_tmp);
|
path_max_tmp);
|
||||||
break;
|
break;
|
||||||
@@ -402,15 +388,18 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb,
|
|||||||
|
|
||||||
if (ret < 0 || ret == DECODE_ERROR_UNKTYPE) {
|
if (ret < 0 || ret == DECODE_ERROR_UNKTYPE) {
|
||||||
pathcpy_trunc(pc->erroredUrl, dc->utf8url);
|
pathcpy_trunc(pc->erroredUrl, dc->utf8url);
|
||||||
if (ret != DECODE_ERROR_UNKTYPE) {
|
if (ret != DECODE_ERROR_UNKTYPE)
|
||||||
dc->error = DECODE_ERROR_FILE;
|
dc->error = DECODE_ERROR_FILE;
|
||||||
} else {
|
else
|
||||||
dc->error = DECODE_ERROR_UNKTYPE;
|
dc->error = DECODE_ERROR_UNKTYPE;
|
||||||
closeInputStream(&inStream);
|
|
||||||
}
|
|
||||||
dc->stop = 0;
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stop:
|
||||||
|
if (close_instream)
|
||||||
|
closeInputStream(&inStream);
|
||||||
|
stop_no_close:
|
||||||
|
dc->state = DECODE_STATE_STOP;
|
||||||
|
dc->stop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decoderInit(PlayerControl * pc, OutputBuffer * cb,
|
static int decoderInit(PlayerControl * pc, OutputBuffer * cb,
|
||||||
|
|||||||
@@ -337,7 +337,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
|||||||
if (bread < 0) {
|
if (bread < 0) {
|
||||||
ERROR("Error not a AAC stream.\n");
|
ERROR("Error not a AAC stream.\n");
|
||||||
faacDecClose(decoder);
|
faacDecClose(decoder);
|
||||||
closeInputStream(b.inStream);
|
|
||||||
if (b.buffer)
|
if (b.buffer)
|
||||||
free(b.buffer);
|
free(b.buffer);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -413,7 +412,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
|||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
faacDecClose(decoder);
|
faacDecClose(decoder);
|
||||||
closeInputStream(b.inStream);
|
|
||||||
if (b.buffer)
|
if (b.buffer)
|
||||||
free(b.buffer);
|
free(b.buffer);
|
||||||
|
|
||||||
@@ -425,12 +423,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
|||||||
dc->seek = 0;
|
dc->seek = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,17 +131,6 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
/*if(dc->seek) {
|
|
||||||
dc->seekError = 1;
|
|
||||||
dc->seek = 0;
|
|
||||||
} */
|
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
}
|
}
|
||||||
afCloseFile(af_fp);
|
afCloseFile(af_fp);
|
||||||
|
|
||||||
|
|||||||
@@ -410,14 +410,6 @@ static int flac_decode_internal(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
flushOutputBuffer(data.cb);
|
flushOutputBuffer(data.cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(dc->seek) {
|
|
||||||
dc->seekError = 1;
|
|
||||||
dc->seek = 0;
|
|
||||||
} */
|
|
||||||
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (data.replayGainInfo)
|
if (data.replayGainInfo)
|
||||||
freeReplayGainInfo(data.replayGainInfo);
|
freeReplayGainInfo(data.replayGainInfo);
|
||||||
@@ -425,8 +417,6 @@ fail:
|
|||||||
if (flacDec)
|
if (flacDec)
|
||||||
flac_delete(flacDec);
|
flac_delete(flacDec);
|
||||||
|
|
||||||
closeInputStream(inStream);
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
ERROR("flac %s\n", err);
|
ERROR("flac %s\n", err);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -221,12 +221,6 @@ static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
|||||||
|
|
||||||
MikMod_Exit();
|
MikMod_Exit();
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1028,14 +1028,10 @@ static int mp3_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
|
|
||||||
if (openMp3FromInputStream(inStream, &data, dc, &tag, &replayGainInfo) <
|
if (openMp3FromInputStream(inStream, &data, dc, &tag, &replayGainInfo) <
|
||||||
0) {
|
0) {
|
||||||
closeInputStream(inStream);
|
|
||||||
if (!dc->stop) {
|
if (!dc->stop) {
|
||||||
ERROR
|
ERROR
|
||||||
("Input does not appear to be a mp3 bit stream.\n");
|
("Input does not appear to be a mp3 bit stream.\n");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1089,8 +1085,6 @@ static int mp3_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
if (replayGainInfo)
|
if (replayGainInfo)
|
||||||
freeReplayGainInfo(replayGainInfo);
|
freeReplayGainInfo(replayGainInfo);
|
||||||
|
|
||||||
closeInputStream(inStream);
|
|
||||||
|
|
||||||
if (dc->seek && data.muteFrame == MUTEFRAME_SEEK) {
|
if (dc->seek && data.muteFrame == MUTEFRAME_SEEK) {
|
||||||
clearOutputBuffer(cb);
|
clearOutputBuffer(cb);
|
||||||
dc->seek = 0;
|
dc->seek = 0;
|
||||||
@@ -1099,12 +1093,6 @@ static int mp3_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
mp3DecodeDataFinalize(&data);
|
mp3DecodeDataFinalize(&data);
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
if (!mp4fh) {
|
if (!mp4fh) {
|
||||||
ERROR("Input does not appear to be a mp4 stream.\n");
|
ERROR("Input does not appear to be a mp4 stream.\n");
|
||||||
free(mp4cb);
|
free(mp4cb);
|
||||||
closeInputStream(inStream);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +134,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
if (track < 0) {
|
if (track < 0) {
|
||||||
ERROR("No AAC track found in mp4 stream.\n");
|
ERROR("No AAC track found in mp4 stream.\n");
|
||||||
mp4ff_close(mp4fh);
|
mp4ff_close(mp4fh);
|
||||||
closeInputStream(inStream);
|
|
||||||
free(mp4cb);
|
free(mp4cb);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -164,7 +162,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
faacDecClose(decoder);
|
faacDecClose(decoder);
|
||||||
mp4ff_close(mp4fh);
|
mp4ff_close(mp4fh);
|
||||||
free(mp4cb);
|
free(mp4cb);
|
||||||
closeInputStream(inStream);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +177,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
ERROR("Error getting audio format of mp4 AAC track.\n");
|
ERROR("Error getting audio format of mp4 AAC track.\n");
|
||||||
faacDecClose(decoder);
|
faacDecClose(decoder);
|
||||||
mp4ff_close(mp4fh);
|
mp4ff_close(mp4fh);
|
||||||
closeInputStream(inStream);
|
|
||||||
free(mp4cb);
|
free(mp4cb);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -296,7 +292,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
free(seekTable);
|
free(seekTable);
|
||||||
faacDecClose(decoder);
|
faacDecClose(decoder);
|
||||||
mp4ff_close(mp4fh);
|
mp4ff_close(mp4fh);
|
||||||
closeInputStream(inStream);
|
|
||||||
free(mp4cb);
|
free(mp4cb);
|
||||||
|
|
||||||
if (dc->state != DECODE_STATE_DECODE)
|
if (dc->state != DECODE_STATE_DECODE)
|
||||||
@@ -308,12 +303,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
}
|
}
|
||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,13 +156,9 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
mpc_streaminfo_init(&info);
|
mpc_streaminfo_init(&info);
|
||||||
|
|
||||||
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
|
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
|
||||||
closeInputStream(inStream);
|
|
||||||
if (!dc->stop) {
|
if (!dc->stop) {
|
||||||
ERROR("Not a valid musepack stream\n");
|
ERROR("Not a valid musepack stream\n");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -170,13 +166,9 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
mpc_decoder_setup(&decoder, &reader);
|
mpc_decoder_setup(&decoder, &reader);
|
||||||
|
|
||||||
if (!mpc_decoder_initialize(&decoder, &info)) {
|
if (!mpc_decoder_initialize(&decoder, &info)) {
|
||||||
closeInputStream(inStream);
|
|
||||||
if (!dc->stop) {
|
if (!dc->stop) {
|
||||||
ERROR("Not a valid musepack stream\n");
|
ERROR("Not a valid musepack stream\n");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -264,19 +256,10 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
replayGainInfo);
|
replayGainInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeInputStream(inStream);
|
|
||||||
|
|
||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
freeReplayGainInfo(replayGainInfo);
|
freeReplayGainInfo(replayGainInfo);
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,15 +37,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static void oggflac_cleanup(InputStream * inStream,
|
static void oggflac_cleanup(FlacData * data,
|
||||||
FlacData * data,
|
|
||||||
OggFLAC__SeekableStreamDecoder * decoder)
|
OggFLAC__SeekableStreamDecoder * decoder)
|
||||||
{
|
{
|
||||||
if (data->replayGainInfo)
|
if (data->replayGainInfo)
|
||||||
freeReplayGainInfo(data->replayGainInfo);
|
freeReplayGainInfo(data->replayGainInfo);
|
||||||
if (decoder)
|
if (decoder)
|
||||||
OggFLAC__seekable_stream_decoder_delete(decoder);
|
OggFLAC__seekable_stream_decoder_delete(decoder);
|
||||||
closeInputStream(inStream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
|
static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
|
||||||
@@ -330,7 +328,8 @@ static MpdTag *oggflac_TagDup(char *file)
|
|||||||
* data.tag will be set or unset, that's all we care about */
|
* data.tag will be set or unset, that's all we care about */
|
||||||
decoder = full_decoder_init_and_read_metadata(&data, 1);
|
decoder = full_decoder_init_and_read_metadata(&data, 1);
|
||||||
|
|
||||||
oggflac_cleanup(&inStream, &data, decoder);
|
oggflac_cleanup(&data, decoder);
|
||||||
|
closeInputStream(&inStream);
|
||||||
|
|
||||||
return data.tag;
|
return data.tag;
|
||||||
}
|
}
|
||||||
@@ -388,11 +387,8 @@ static int oggflac_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
flushOutputBuffer(data.cb);
|
flushOutputBuffer(data.cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
oggflac_cleanup(inStream, &data, decoder);
|
oggflac_cleanup(&data, decoder);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,11 +92,10 @@ static int ogg_seek_cb(void *vdata, ogg_int64_t offset, int whence)
|
|||||||
return seekInputStream(data->inStream, offset, whence);
|
return seekInputStream(data->inStream, offset, whence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: check Ogg libraries API and see if we can just not have this func */
|
||||||
static int ogg_close_cb(void *vdata)
|
static int ogg_close_cb(void *vdata)
|
||||||
{
|
{
|
||||||
OggCallbackData *data = (OggCallbackData *) vdata;
|
return 0;
|
||||||
|
|
||||||
return closeInputStream(data->inStream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static long ogg_tell_cb(void *vdata)
|
static long ogg_tell_cb(void *vdata)
|
||||||
@@ -253,7 +252,6 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
callbacks.close_func = ogg_close_cb;
|
callbacks.close_func = ogg_close_cb;
|
||||||
callbacks.tell_func = ogg_tell_cb;
|
callbacks.tell_func = ogg_tell_cb;
|
||||||
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
|
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
|
||||||
closeInputStream(inStream);
|
|
||||||
if (!dc->stop) {
|
if (!dc->stop) {
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case OV_EREAD:
|
case OV_EREAD:
|
||||||
@@ -278,9 +276,6 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
ERROR("Error decoding Ogg Vorbis stream: %s\n",
|
ERROR("Error decoding Ogg Vorbis stream: %s\n",
|
||||||
errorStr);
|
errorStr);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -358,12 +353,6 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
|
|
||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
if (dc->stop) {
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
} else
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,9 +218,6 @@ static void wavpack_decode(OutputBuffer *cb, DecoderControl *dc,
|
|||||||
} while (samplesgot == samplesreq);
|
} while (samplesgot == samplesreq);
|
||||||
|
|
||||||
flushOutputBuffer(cb);
|
flushOutputBuffer(cb);
|
||||||
|
|
||||||
dc->state = DECODE_STATE_STOP;
|
|
||||||
dc->stop = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *wavpack_tag(WavpackContext *wpc, char *key)
|
static char *wavpack_tag(WavpackContext *wpc, char *key)
|
||||||
@@ -450,7 +447,6 @@ static int wavpack_streamdecode(OutputBuffer *cb, DecoderControl *dc,
|
|||||||
wavpack_decode(cb, dc, wpc, can_seek(is), NULL);
|
wavpack_decode(cb, dc, wpc, can_seek(is), NULL);
|
||||||
|
|
||||||
WavpackCloseFile(wpc);
|
WavpackCloseFile(wpc);
|
||||||
closeInputStream(is); /* calling side doesn't do this in mpd 0.13.0 */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user