aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/inputPlugins')
-rw-r--r--src/inputPlugins/mp3_plugin.c9
-rw-r--r--src/inputPlugins/ogg_plugin.c3
2 files changed, 5 insertions, 7 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index 9c5eb824a..ef82c7122 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -575,12 +575,12 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) {
MP3_DATA_OUTPUT_BUFFER_SIZE,
data->elapsedTime,
data->bitRate/1000);
+ data->outputPtr = data->outputBuffer;
+
if(ret == OUTPUT_BUFFER_DC_STOP) {
return DECODE_BREAK;
}
- data->outputPtr = data->outputBuffer;
-
if(ret == OUTPUT_BUFFER_DC_SEEK) break;
}
}
@@ -640,7 +640,7 @@ void initAudioFormatFromMp3DecodeData(mp3DecodeData * data, AudioFormat * af) {
int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
mp3DecodeData data;
- MpdTag * tag;
+ MpdTag * tag = NULL;
if(openMp3FromInputStream(inStream, &data, dc, &tag) < 0) {
closeInputStream(inStream);
@@ -664,7 +664,6 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
if(tag) freeMpdTag(tag);
tag = newMpdTag();
tag->title = strdup(inStream->metaTitle);
- /* free ths now, so we know we are done with it */
free(inStream->metaTitle);
inStream->metaTitle = NULL;
if(inStream->metaName) {
@@ -694,7 +693,7 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
while(mp3Read(&data,cb,dc)!=DECODE_BREAK);
/* send last little bit if not dc->stop */
- if(data.outputPtr!=data.outputBuffer && data.flush) {
+ if(!dc->stop && data.outputPtr!=data.outputBuffer && data.flush) {
sendDataToOutputBuffer(cb, NULL, dc,
data.inStream->seekable,
data.outputBuffer,
diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c
index b50ea5ea1..adf11cf69 100644
--- a/src/inputPlugins/ogg_plugin.c
+++ b/src/inputPlugins/ogg_plugin.c
@@ -321,9 +321,8 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream)
ov_pcm_tell(&vf)/
dc->audioFormat.sampleRate,
bitRate);
-
- if(dc->stop) break;
chunkpos = 0;
+ if(dc->stop) break;
}
}