mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
Use g_strerror() instead of strerror() - we want UTF-8.
Original commit message from CVS: * gst/gstplugin.c: (gst_plugin_load_file): * plugins/elements/gstfilesrc.c: (gst_mmap_buffer_finalize), (gst_file_src_map_region), (gst_file_src_start): * plugins/indexers/gstfileindex.c: (gst_file_index_load), (gst_file_index_commit): Use g_strerror() instead of strerror() - we want UTF-8.
This commit is contained in:
parent
f2d78a7a87
commit
bf22daa437
4 changed files with 21 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2006-11-06 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/gstplugin.c: (gst_plugin_load_file):
|
||||||
|
* plugins/elements/gstfilesrc.c: (gst_mmap_buffer_finalize),
|
||||||
|
(gst_file_src_map_region), (gst_file_src_start):
|
||||||
|
* plugins/indexers/gstfileindex.c: (gst_file_index_load),
|
||||||
|
(gst_file_index_commit):
|
||||||
|
Use g_strerror() instead of strerror() - we want UTF-8.
|
||||||
|
|
||||||
2006-11-06 Tim-Philipp Müller <tim at centricular dot net>
|
2006-11-06 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
Patch by: Peter Kjellerstedt <pkj at axis com>
|
Patch by: Peter Kjellerstedt <pkj at axis com>
|
||||||
|
|
|
@ -403,8 +403,8 @@ gst_plugin_load_file (const gchar * filename, GError ** error)
|
||||||
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "problem accessing file");
|
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "problem accessing file");
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GST_PLUGIN_ERROR,
|
GST_PLUGIN_ERROR,
|
||||||
GST_PLUGIN_ERROR_MODULE, "Problem accessing file %s: %s\n", filename,
|
GST_PLUGIN_ERROR_MODULE, "Problem accessing file %s: %s", filename,
|
||||||
strerror (errno));
|
g_strerror (errno));
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -513,13 +513,13 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer)
|
||||||
#ifdef MADV_DONTNEED
|
#ifdef MADV_DONTNEED
|
||||||
/* madvise to tell the kernel what to do with it */
|
/* madvise to tell the kernel what to do with it */
|
||||||
if (madvise (data, size, MADV_DONTNEED) < 0) {
|
if (madvise (data, size, MADV_DONTNEED) < 0) {
|
||||||
GST_WARNING_OBJECT (src, "warning: madvise failed: %s", strerror (errno));
|
GST_WARNING_OBJECT (src, "warning: madvise failed: %s", g_strerror (errno));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* now unmap the memory */
|
/* now unmap the memory */
|
||||||
if (munmap (data, size) < 0) {
|
if (munmap (data, size) < 0) {
|
||||||
GST_WARNING_OBJECT (src, "warning: munmap failed: %s", strerror (errno));
|
GST_WARNING_OBJECT (src, "warning: munmap failed: %s", g_strerror (errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cast to unsigned long, since there's no gportable way to print
|
/* cast to unsigned long, since there's no gportable way to print
|
||||||
|
@ -558,7 +558,8 @@ gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size,
|
||||||
if (src->sequential) {
|
if (src->sequential) {
|
||||||
/* madvise to tell the kernel what to do with it */
|
/* madvise to tell the kernel what to do with it */
|
||||||
if (madvise (mmapregion, size, MADV_SEQUENTIAL) < 0) {
|
if (madvise (mmapregion, size, MADV_SEQUENTIAL) < 0) {
|
||||||
GST_WARNING_OBJECT (src, "warning: madvise failed: %s", strerror (errno));
|
GST_WARNING_OBJECT (src, "warning: madvise failed: %s",
|
||||||
|
g_strerror (errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -577,7 +578,7 @@ mmap_failed:
|
||||||
if (!testonly) {
|
if (!testonly) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
|
||||||
("mmap (0x%08lx, %d, 0x%llx) failed: %s",
|
("mmap (0x%08lx, %d, 0x%llx) failed: %s",
|
||||||
(gulong) size, src->fd, offset, strerror (errno)));
|
(gulong) size, src->fd, offset, g_strerror (errno)));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -946,7 +947,7 @@ gst_file_src_start (GstBaseSrc * basesrc)
|
||||||
|
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
GST_LOG_OBJECT (src, "disabling seeking, not in mmap mode and lseek "
|
GST_LOG_OBJECT (src, "disabling seeking, not in mmap mode and lseek "
|
||||||
"failed: %s", strerror (errno));
|
"failed: %s", g_strerror (errno));
|
||||||
src->seekable = FALSE;
|
src->seekable = FALSE;
|
||||||
} else {
|
} else {
|
||||||
src->seekable = TRUE;
|
src->seekable = TRUE;
|
||||||
|
|
|
@ -395,7 +395,7 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
g_free (path);
|
g_free (path);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
GST_ERROR_OBJECT (index,
|
GST_ERROR_OBJECT (index,
|
||||||
"Can't open '%s': %s", path, strerror (errno));
|
"Can't open '%s': %s", path, g_strerror (errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ gst_file_index_load (GstFileIndex * index)
|
||||||
close (fd);
|
close (fd);
|
||||||
if (array_data == MAP_FAILED) {
|
if (array_data == MAP_FAILED) {
|
||||||
GST_ERROR_OBJECT (index,
|
GST_ERROR_OBJECT (index,
|
||||||
"mmap %s failed: %s", path, strerror (errno));
|
"mmap %s failed: %s", path, g_strerror (errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +601,8 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
|
||||||
(GHFunc) _file_index_id_save_xml, writers);
|
(GHFunc) _file_index_id_save_xml, writers);
|
||||||
|
|
||||||
if (mkdir (index->location, 0777) && errno != EEXIST) {
|
if (mkdir (index->location, 0777) && errno != EEXIST) {
|
||||||
GST_ERROR_OBJECT (index, "mkdir %s: %s", index->location, strerror (errno));
|
GST_ERROR_OBJECT (index, "mkdir %s: %s", index->location,
|
||||||
|
g_strerror (errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue