+2004-02-22 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * gst/elements/gstfilesink.c: (gst_filesink_open_file):
+ * gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
+ * gst/elements/gstmultifilesrc.c: (gst_multifilesrc_open_file):
+
2004-02-20 Andy Wingo <wingo@pobox.com>
* gst/gstbin.c:
g_return_val_if_fail (!GST_FLAG_IS_SET (sink, GST_FILESINK_OPEN), FALSE);
/* open the file */
- if (!sink->filename)
+ if (sink->filename == NULL || sink->filename[0] == '\0')
{
GST_ELEMENT_ERROR (sink, RESOURCE, NOT_FOUND,
- (_("No filename specified.")), (NULL));
+ (_("No file name specified for writing.")), (NULL));
return FALSE;
}
{
g_return_val_if_fail (!GST_FLAG_IS_SET (src ,GST_FILESRC_OPEN), FALSE);
- if (src->filename == NULL)
+ if (src->filename == NULL || src->filename[0] == '\0')
{
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
- (_("No filename specified.")), (NULL));
- return FALSE;
- }
-
- if (src->filename == NULL)
- {
- GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
- (_("No file specified for reading.")), (NULL));
+ (_("No file name specified for reading.")), (NULL));
return FALSE;
}
{
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN), FALSE);
+ if (src->currentfilename == NULL || src->currentfilename[0] == '\0')
+ {
+ GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
+ (_("No file name specified for reading.")), (NULL));
+ return FALSE;
+ }
+
/* open the file */
src->fd = open ((const char *) src->currentfilename, O_RDONLY);
-
if (src->fd < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("Could not open file \"%s\" for reading."), src->currentfilename),
g_return_val_if_fail (!GST_FLAG_IS_SET (sink, GST_FILESINK_OPEN), FALSE);
/* open the file */
- if (!sink->filename)
+ if (sink->filename == NULL || sink->filename[0] == '\0')
{
GST_ELEMENT_ERROR (sink, RESOURCE, NOT_FOUND,
- (_("No filename specified.")), (NULL));
+ (_("No file name specified for writing.")), (NULL));
return FALSE;
}
{
g_return_val_if_fail (!GST_FLAG_IS_SET (src ,GST_FILESRC_OPEN), FALSE);
- if (src->filename == NULL)
+ if (src->filename == NULL || src->filename[0] == '\0')
{
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
- (_("No filename specified.")), (NULL));
- return FALSE;
- }
-
- if (src->filename == NULL)
- {
- GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
- (_("No file specified for reading.")), (NULL));
+ (_("No file name specified for reading.")), (NULL));
return FALSE;
}
{
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN), FALSE);
+ if (src->currentfilename == NULL || src->currentfilename[0] == '\0')
+ {
+ GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
+ (_("No file name specified for reading.")), (NULL));
+ return FALSE;
+ }
+
/* open the file */
src->fd = open ((const char *) src->currentfilename, O_RDONLY);
-
if (src->fd < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("Could not open file \"%s\" for reading."), src->currentfilename),