decoder/flac: do not seek when DecoderCommand::STOP is received
libFLAC tries to keep on seeking a stream even after a (fatal) read error has occurred. Let the DecoderClient decide whether proceeding is possible. This fixes a crash bug when playing a file over NFS and the NFS connection fails.
This commit is contained in:
parent
715ef846b6
commit
d1e5c90c3b
@ -31,6 +31,11 @@ FlacInput::Read(FLAC__byte buffer[], size_t *bytes) noexcept
|
|||||||
inline FLAC__StreamDecoderSeekStatus
|
inline FLAC__StreamDecoderSeekStatus
|
||||||
FlacInput::Seek(FLAC__uint64 absolute_byte_offset) noexcept
|
FlacInput::Seek(FLAC__uint64 absolute_byte_offset) noexcept
|
||||||
{
|
{
|
||||||
|
if (client != nullptr && client->GetCommand() == DecoderCommand::STOP)
|
||||||
|
/* do not seek if we're supposed to stop playback (or
|
||||||
|
if an error has occurred) */
|
||||||
|
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
|
||||||
|
|
||||||
if (!input_stream.IsSeekable())
|
if (!input_stream.IsSeekable())
|
||||||
return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
|
return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user