From f1754fcb8669ee18c6439dd2933e1d2e4b461a03 Mon Sep 17 00:00:00 2001 From: Timo Hirvonen Date: Sat, 14 Oct 2006 13:52:00 +0300 Subject: [PATCH] Don't try to get duration for streams Never call input plugins' duration callback for streams. Simplifies input plugin code a little. --- aac.c | 4 ---- flac.c | 3 --- input.c | 2 ++ 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/aac.c b/aac.c index 80a5b6a..727b705 100644 --- a/aac.c +++ b/aac.c @@ -400,11 +400,7 @@ static int aac_duration(struct input_plugin_data *ip_data) off_t file_size; char *sample_buf; - if (ip_data->remote) - return 0; - file_size = lseek(ip_data->fd, 0, SEEK_END); - if (file_size == -1) return -IP_ERROR_FUNCTION_NOT_SUPPORTED; diff --git a/flac.c b/flac.c index 55c3800..c4430ee 100644 --- a/flac.c +++ b/flac.c @@ -480,9 +480,6 @@ static int flac_seek(struct input_plugin_data *ip_data, double offset) struct flac_private *priv = ip_data->private; uint64_t sample; - if (ip_data->remote) - return -IP_ERROR_ERRNO; - sample = (uint64_t)(offset * (double)sf_get_rate(ip_data->sf) + 0.5); if (!F(seek_absolute)(priv->dec, sample)) { return -IP_ERROR_ERRNO; diff --git a/input.c b/input.c index 0deb18e..7861e97 100644 --- a/input.c +++ b/input.c @@ -575,6 +575,8 @@ int ip_read_comments(struct input_plugin *ip, struct keyval **comments) int ip_duration(struct input_plugin *ip) { + if (ip->data.remote) + return -1; if (ip->duration == -1) ip->duration = ip->ops->duration(&ip->data); if (ip->duration < 0) -- 2.11.4.GIT