[inputs] enable seek on non-live http streams

This commit is contained in:
whatdoineed2do/Ray 2019-05-11 15:53:59 +01:00
parent c36df4fb8e
commit 37ce8dd607
1 changed files with 10 additions and 0 deletions

View File

@ -120,6 +120,15 @@ seek(struct input_source *source, int seek_ms)
return transcode_seek(source->input_ctx, seek_ms);
}
static int
seek_http(struct input_source *source, int seek_ms)
{
// stream is live/unknown length so obvs can't seek
if (source->len_ms == 0)
return -1;
return transcode_seek(source->input_ctx, seek_ms);
}
static int
metadata_get_http(struct input_metadata *metadata, struct input_source *source)
{
@ -168,4 +177,5 @@ struct input_definition input_http =
.play = play,
.stop = stop,
.metadata_get = metadata_get_http,
.seek = seek_http
};