} else {
src->seekable = TRUE;
}
- lseek (src->fd, 0, SEEK_SET);
+
+ if (lseek (src->fd, 0, SEEK_SET) < 0)
+ goto seek_failed;
}
/* We can only really do seeking on regular files - for other file types, we
}
was_socket:
{
- GST_ERROR_OBJECT (src, "Is a Socket");
+ GST_ERROR_OBJECT (src, "Is a Socket");
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("File \"\" is a socket."), (NULL));
close (src->fd);
return FALSE;
}
+seek_failed:
+ {
+ GST_ERROR_OBJECT (src, "Seek failed...");
+ GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), GST_ERROR_SYSTEM);
+ close (src->fd);
+ return FALSE;
+ }
}
/* unmap and close the file */