fix errors
authorThomas Vander Stichele <thomas@apestaart.org>
Sun, 22 Feb 2004 14:07:55 +0000 (14:07 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sun, 22 Feb 2004 14:07:55 +0000 (14:07 +0000)
Original commit message from CVS:
fix errors

ChangeLog
gst/elements/gstfilesink.c
gst/elements/gstfilesrc.c
gst/elements/gstmultifilesrc.c
plugins/elements/gstfilesink.c
plugins/elements/gstfilesrc.c
plugins/elements/gstmultifilesrc.c

index 3c28608..cbedc79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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:
index 66d7f0f..fb575cd 100644 (file)
@@ -242,10 +242,10 @@ gst_filesink_open_file (GstFileSink *sink)
   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;
   }
 
index f32ae0d..7882e98 100644 (file)
@@ -670,17 +670,10 @@ gst_filesrc_open_file (GstFileSrc *src)
 {
   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;
   }
 
index 248e4b3..454acf6 100644 (file)
@@ -236,9 +236,15 @@ gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad)
 {
   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),
index 66d7f0f..fb575cd 100644 (file)
@@ -242,10 +242,10 @@ gst_filesink_open_file (GstFileSink *sink)
   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;
   }
 
index f32ae0d..7882e98 100644 (file)
@@ -670,17 +670,10 @@ gst_filesrc_open_file (GstFileSrc *src)
 {
   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;
   }
 
index 248e4b3..454acf6 100644 (file)
@@ -236,9 +236,15 @@ gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad)
 {
   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),