diff options
Diffstat (limited to 'src/inputPlugins')
-rw-r--r-- | src/inputPlugins/flac_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index 06994d3dd..c90ff21ca 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -42,6 +42,10 @@ static flac_read_status flacRead(mpd_unused const flac_decoder * flacDec, else return flac_read_status_abort; } + + if (r == 0 && decoder_get_command(data->decoder) == DECODE_COMMAND_SEEK) + return flac_read_status_eof; + return flac_read_status_continue; } @@ -413,8 +417,6 @@ static int flac_decode_internal(struct decoder * decoder, while (1) { if (!flac_process_single(flacDec)) break; - if (flac_get_state(flacDec) == flac_decoder_eof) - break; if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) { FLAC__uint64 sampleToSeek = decoder_seek_where(decoder) * data.audio_format.sampleRate + 0.5; @@ -426,7 +428,8 @@ static int flac_decode_internal(struct decoder * decoder, decoder_command_finished(decoder); } else decoder_seek_error(decoder); - } + } else if (flac_get_state(flacDec) == flac_decoder_eof) + break; } if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) { flacPrintErroredState(flac_get_state(flacDec)); diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 9b22dc74c..c836a7a46 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -1006,9 +1006,18 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) break; } - if (decoder_get_command(decoder) != DECODE_COMMAND_NONE) + switch (decoder_get_command(decoder)) { + case DECODE_COMMAND_NONE: + case DECODE_COMMAND_START: + break; + + case DECODE_COMMAND_STOP: return DECODE_BREAK; + case DECODE_COMMAND_SEEK: + return DECODE_CONT; + } + return ret; } |