Commit 1a310800 authored by Wim Taymans's avatar Wim Taymans

Some more fseeko checks.

Original commit message from CVS:
* configure.ac:
* gst/playback/gstqueue2.c: (gst_queue_create_read):
Some more fseeko checks.
parent b7c415e7
2007-06-06 Wim Taymans <wim@fluendo.com>
* configure.ac:
* gst/playback/gstqueue2.c: (gst_queue_create_read):
Some more fseeko checks.
2007-06-06 Wim Taymans <wim@fluendo.com>
* configure.ac:
......@@ -230,6 +230,9 @@ AC_C_INLINE
dnl *** checks for library functions ***
dnl check for fseeko()
AC_FUNC_FSEEKO
dnl Check for fast float to int casting as defined in C99
dnl used in gst-libs/gst/floatcast/floatcast.h
AC_C99_FUNC_LRINT
......
......@@ -786,7 +786,6 @@ gst_queue_create_read (GstQueue * queue, guint64 offset, guint length,
{
size_t res;
GstBuffer *buf;
off_t sres;
/* check if we have enough data at @offset. If there is not enough data, we
* block and wait. */
......@@ -794,9 +793,17 @@ gst_queue_create_read (GstQueue * queue, guint64 offset, guint length,
GST_QUEUE_WAIT_ADD_CHECK (queue, out_flushing);
}
sres = fseeko (queue->temp_file, offset, SEEK_SET);
if (G_UNLIKELY (sres < 0))
#ifdef HAVE_FSEEKO
if (fseeko (queue->temp_file, (off_t) offset, SEEK_SET) != 0)
goto seek_failed;
#elif defined (G_OS_UNIX)
if (lseek (fileno (queue->temp_file), (off_t) offset,
SEEK_SET) == (off_t) - 1)
goto seek_failed;
#else
if (fseek (queue->temp_file, (long) offset, SEEK_SET) != 0)
goto seek_failed;
#endif
buf = gst_buffer_new_and_alloc (length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment