From 37ce8dd607c6472fe7d6262fd5adc1358ef8b449 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Sat, 11 May 2019 15:53:59 +0100 Subject: [PATCH] [inputs] enable seek on non-live http streams --- src/inputs/file_http.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/inputs/file_http.c b/src/inputs/file_http.c index 6864e103..ca570ecb 100644 --- a/src/inputs/file_http.c +++ b/src/inputs/file_http.c @@ -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 };