diff options
Diffstat (limited to 'gst/elements/gstmultifilesrc.c')
-rw-r--r-- | gst/elements/gstmultifilesrc.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/gst/elements/gstmultifilesrc.c b/gst/elements/gstmultifilesrc.c index c3eca0d329..a561588abf 100644 --- a/gst/elements/gstmultifilesrc.c +++ b/gst/elements/gstmultifilesrc.c @@ -26,12 +26,10 @@ #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> -#include <errno.h> #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "gst/gst_private.h" #include "gstmultidisksrc.h" @@ -255,9 +253,7 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad) if (src->fd < 0) { perror ("open"); - gst_element_gerror (GST_ELEMENT (src), GST_ERROR_DEVICE, - g_strdup_printf (_("Could not open file \"%s\""), src->currentfilename), - g_strdup_printf ("error opening file \"%s\": %s", src->currentfilename, strerror (errno))); + gst_element_error (GST_ELEMENT (src), g_strconcat("opening file \"", src->currentfilename, "\"", NULL)); return FALSE; } else { /* find the file length */ @@ -265,16 +261,13 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad) lseek (src->fd, 0, SEEK_SET); /* map the file into memory */ src->map = mmap (NULL, src->size, PROT_READ, MAP_SHARED, src->fd, 0); + madvise (src->map,src->size, 2); /* collapse state if that failed */ if (src->map == NULL) { close (src->fd); - gst_element_gerror (GST_ELEMENT (src), GST_ERROR_DEVICE, - g_strdup_printf (_("Could not open file \"%s\""), src->currentfilename), - g_strdup_printf ("error mmapping file \"%s\": %s", - src->currentfilename, strerror (errno))); + gst_element_error (GST_ELEMENT (src),"mmapping file"); return FALSE; } - madvise (src->map, src->size, 2); GST_FLAG_SET (src, GST_MULTIDISKSRC_OPEN); src->new_seek = TRUE; } |