summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d77dbaa)
raw | patch | inline | side by side (parent: d77dbaa)
author | Benjamin Otte <otte@gnome.org> | |
Mon, 12 Jul 2004 21:57:35 +0000 (21:57 +0000) | ||
committer | Benjamin Otte <otte@gnome.org> | |
Mon, 12 Jul 2004 21:57:35 +0000 (21:57 +0000) |
Original commit message from CVS:
* gst/gsttypes.h:
get rid of GST_O_READONLY, GST_FILE_MODE_READ and
GST_FILE_MODE_WRITE, I don't want them in the exported headers. It
just causes support madness
* gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
make it work without this
* gst/indexers/gstfileindex.c: (_file_index_id_save_entries),
(gst_file_index_commit):
glib IO channels don't want binary mode
* testsuite/bytestream/filepadsink.c: (main):
* testsuite/bytestream/test1.c: (read_param_file):
use "rb" instead of GST_FILE_MODE_READ, it works on POSIX systems
* gst/gsttypes.h:
get rid of GST_O_READONLY, GST_FILE_MODE_READ and
GST_FILE_MODE_WRITE, I don't want them in the exported headers. It
just causes support madness
* gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
make it work without this
* gst/indexers/gstfileindex.c: (_file_index_id_save_entries),
(gst_file_index_commit):
glib IO channels don't want binary mode
* testsuite/bytestream/filepadsink.c: (main):
* testsuite/bytestream/test1.c: (read_param_file):
use "rb" instead of GST_FILE_MODE_READ, it works on POSIX systems
diff --git a/ChangeLog b/ChangeLog
index 21ebedc7735f14aad506b02a407aab50b1d97d4a..2b39b8e2a7af00168ddbdee19c3dd6ab0d1cb20b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2004-07-12 Benjamin Otte <otte@gnome.org>
+
+ * gst/gsttypes.h:
+ get rid of GST_O_READONLY, GST_FILE_MODE_READ and
+ GST_FILE_MODE_WRITE, I don't want them in the exported headers. It
+ just causes support madness
+ * gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
+ make it work without this
+ * gst/indexers/gstfileindex.c: (_file_index_id_save_entries),
+ (gst_file_index_commit):
+ glib IO channels don't want binary mode
+ * testsuite/bytestream/filepadsink.c: (main):
+ * testsuite/bytestream/test1.c: (read_param_file):
+ use "rb" instead of GST_FILE_MODE_READ, it works on POSIX systems
+
2004-07-12 Benjamin Otte <otte@gnome.org>
* gst/gstelement.c: (gst_element_class_init),
index 22c4cd9c979512cb03ae02f68c93ecdc9800134e..3cb1959e70e66b8ba14cd6fac1a6e0e92cc1a960 100644 (file)
#ifndef S_ISSOCK
#define S_ISSOCK(x) (0)
#endif
+/* FIXME: is that enough or should we do #ifdef __WIN32__ stuff? */
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
/**********************************************************************
* GStreamer Default File Source
GST_INFO_OBJECT (src, "opening file %s", src->filename);
/* open the file */
- src->fd = open (src->filename, GST_O_READONLY);
+ src->fd = open (src->filename, O_RDONLY | O_BINARY);
if (src->fd < 0) {
if (errno == ENOENT)
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
diff --git a/gst/gsttypes.h b/gst/gsttypes.h
index ccd17672137b3a32e873df23c8aeee64711c31f1..836cb4ad3bd68dae6feea5f08c1f55c22cc33668 100644 (file)
--- a/gst/gsttypes.h
+++ b/gst/gsttypes.h
#define GST_PADDING 4
#define GST_PADDING_INIT { 0 }
-#ifdef WIN32
-#define GST_FILE_MODE_READ "rb"
-#define GST_FILE_MODE_WRITE "wb"
-#define GST_O_READONLY O_RDONLY|O_BINARY
-#else
-#define GST_FILE_MODE_READ "r"
-#define GST_FILE_MODE_WRITE "w"
-#define GST_O_READONLY O_RDONLY
-#endif
G_END_DECLS
index de4528d44780cd42f10d189731f999a27b751599..ee7d8918d43712b7c3826c44f6d047ad5be69409 100644 (file)
err = NULL;
path = g_strdup_printf ("%s/%d", prefix, ii->id);
- chan = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+ chan = g_io_channel_new_file (path, "w", &err);
g_free (path);
if (err)
goto fail;
}
path = g_strdup_printf ("%s/gstindex.xml", index->location);
- tocfile = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+ tocfile = g_io_channel_new_file (path, "w", &err);
g_free (path);
if (err) {
GST_ERROR_OBJECT (index, "%s", err->message);
index 22c4cd9c979512cb03ae02f68c93ecdc9800134e..3cb1959e70e66b8ba14cd6fac1a6e0e92cc1a960 100644 (file)
#ifndef S_ISSOCK
#define S_ISSOCK(x) (0)
#endif
+/* FIXME: is that enough or should we do #ifdef __WIN32__ stuff? */
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
/**********************************************************************
* GStreamer Default File Source
GST_INFO_OBJECT (src, "opening file %s", src->filename);
/* open the file */
- src->fd = open (src->filename, GST_O_READONLY);
+ src->fd = open (src->filename, O_RDONLY | O_BINARY);
if (src->fd < 0) {
if (errno == ENOENT)
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
index de4528d44780cd42f10d189731f999a27b751599..ee7d8918d43712b7c3826c44f6d047ad5be69409 100644 (file)
err = NULL;
path = g_strdup_printf ("%s/%d", prefix, ii->id);
- chan = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+ chan = g_io_channel_new_file (path, "w", &err);
g_free (path);
if (err)
goto fail;
}
path = g_strdup_printf ("%s/gstindex.xml", index->location);
- tocfile = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+ tocfile = g_io_channel_new_file (path, "w", &err);
g_free (path);
if (err) {
GST_ERROR_OBJECT (index, "%s", err->message);
diff --git a/tests/old/testsuite/bytestream/filepadsink.c b/tests/old/testsuite/bytestream/filepadsink.c
index 7ac762687976795dfb45a853db531396819c9662..550fda4f1dc6a1ca6d79dbcec53a0c57e0a9bc6f 100644 (file)
if (!gst_element_link (src, sink))
g_assert_not_reached ();
g_object_set (src, "location", THE_FILE, NULL);
- GST_FP_SINK (sink)->stream = fopen (THE_FILE, GST_FILE_MODE_READ);
+ GST_FP_SINK (sink)->stream = fopen (THE_FILE, "rb");
g_assert (GST_FP_SINK (sink)->stream);
/* check correct file sizes */
if (fseek (GST_FP_SINK (sink)->stream, 0, SEEK_END) != 0)
index 81ef3f046f41df162c09003b7d845f2121b7904d..fde56402c6d3916a7abd68fded5fb15a324885d3 100644 (file)
gchar *scan_str;
gboolean res = TRUE;
- fp = fopen (filename, GST_FILE_MODE_READ);
+ fp = fopen (filename, "rb");
if (fp == NULL)
return FALSE;
index 7ac762687976795dfb45a853db531396819c9662..550fda4f1dc6a1ca6d79dbcec53a0c57e0a9bc6f 100644 (file)
if (!gst_element_link (src, sink))
g_assert_not_reached ();
g_object_set (src, "location", THE_FILE, NULL);
- GST_FP_SINK (sink)->stream = fopen (THE_FILE, GST_FILE_MODE_READ);
+ GST_FP_SINK (sink)->stream = fopen (THE_FILE, "rb");
g_assert (GST_FP_SINK (sink)->stream);
/* check correct file sizes */
if (fseek (GST_FP_SINK (sink)->stream, 0, SEEK_END) != 0)
index 81ef3f046f41df162c09003b7d845f2121b7904d..fde56402c6d3916a7abd68fded5fb15a324885d3 100644 (file)
gchar *scan_str;
gboolean res = TRUE;
- fp = fopen (filename, GST_FILE_MODE_READ);
+ fp = fopen (filename, "rb");
if (fp == NULL)
return FALSE;