summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2024-05-12 14:21:01 +0200
committerKacper Michajłow <kasper93@gmail.com>2024-05-12 18:06:21 +0200
commita33fd3b4cf18fd8c0acd9f3800a253e7014f8aba (patch)
treed49ccb20641d6d7d12cca3f6316bd368d66854ec /stream
parent21e167cc6a0d66d0d57bb5b751bdff536e7f271c (diff)
downloadmpv-a33fd3b4cf18fd8c0acd9f3800a253e7014f8aba.tar.bz2
mpv-a33fd3b4cf18fd8c0acd9f3800a253e7014f8aba.tar.xz
Revert "stream: don't try to read from all-sparse/no-data files"
The stream layer is just not the right place to make this change since it's also used for completely unrelated purposes such as reading configs. This reverts commit bb7a485c0932375b888a61966970696c06851a15.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_file.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 0a6a697ff6..1744fc13a4 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -358,17 +358,6 @@ static int open_f(stream_t *stream, const struct stream_open_args *args)
setmode(p->fd, O_BINARY);
#endif
-#if HAVE_SEEK_DATA
- if (stream->mode == STREAM_READ) {
- off_t first_data = lseek(p->fd, 0, SEEK_DATA);
- if (first_data == (off_t)-1 && errno == ENXIO) {
- MP_ERR(stream, "File is empty or all sparse (has no data).\n");
- s_close(stream);
- return STREAM_ERROR;
- }
- }
-#endif
-
off_t len = lseek(p->fd, 0, SEEK_END);
lseek(p->fd, 0, SEEK_SET);
if (len != (off_t)-1) {