From 46848a3595a334f38291d65f0e9eaf7ce60da8cc Mon Sep 17 00:00:00 2001 From: Jindrich Makovicka Date: Thu, 25 Jan 2007 17:54:07 +0000 Subject: [PATCH] plugins/elements/gstfilesrc.c: If not using mmap'ed files try to seek to the end instead of the start to determine wh... Original commit message from CVS: Patch by: Jindrich Makovicka * plugins/elements/gstfilesrc.c: (gst_file_src_start): If not using mmap'ed files try to seek to the end instead of the start to determine whether we can seek at all. This fixes the case of 2GB+ files over NFS, where seeks in the first 2GB can succeed but seeks for everything afterwards fail. Fixes #400656 --- ChangeLog | 10 ++++++++++ plugins/elements/gstfilesrc.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 16c2a21f08..2ecb1b71a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-01-25 Sebastian Dröge + + Patch by: Jindrich Makovicka + + * plugins/elements/gstfilesrc.c: (gst_file_src_start): + If not using mmap'ed files try to seek to the end instead of the + start to determine whether we can seek at all. This fixes the case + of 2GB+ files over NFS, where seeks in the first 2GB can succeed but + seeks for everything afterwards fail. Fixes #400656 + 2007-01-25 Wim Taymans * gst/gstcaps.c: (_gst_caps_free), (gst_static_caps_get): diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 3dae638975..f734d74edd 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -943,7 +943,7 @@ gst_file_src_start (GstBaseSrc * basesrc) { /* If not in mmap mode, we need to check if the underlying file is * seekable. */ - off_t res = lseek (src->fd, 0, SEEK_CUR); + off_t res = lseek (src->fd, 0, SEEK_END); if (res < 0) { GST_LOG_OBJECT (src, "disabling seeking, not in mmap mode and lseek " @@ -952,6 +952,7 @@ gst_file_src_start (GstBaseSrc * basesrc) } else { src->seekable = TRUE; } + lseek (src->fd, 0, SEEK_SET); } /* We can only really do seeking on regular files - for other file types, we