aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decoder/flac_plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 2d14ab9df..427d2c4d9 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -69,6 +69,9 @@ flac_seek_cb(G_GNUC_UNUSED const FLAC__StreamDecoder *fd,
{
struct flac_data *data = (struct flac_data *) fdata;
+ if (!data->input_stream->seekable)
+ return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
+
if (!input_stream_seek(data->input_stream, offset, SEEK_SET))
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
@@ -81,6 +84,9 @@ flac_tell_cb(G_GNUC_UNUSED const FLAC__StreamDecoder *fd,
{
struct flac_data *data = (struct flac_data *) fdata;
+ if (!data->input_stream->seekable)
+ return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
+
*offset = (long)(data->input_stream->offset);
return FLAC__STREAM_DECODER_TELL_STATUS_OK;