plugins/elements/gstfilesrc.c: Requesting 0 bytes before the end of the file should...
authorTim-Philipp Müller <tim@centricular.net>
Thu, 27 Jul 2006 12:39:42 +0000 (12:39 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 27 Jul 2006 12:39:42 +0000 (12:39 +0000)
Original commit message from CVS:
* plugins/elements/gstfilesrc.c: (gst_file_src_create_read):
Requesting 0 bytes before the end of the file should result in
FLOW_OK and an empty buffer, not FLOW_UNEXPECTED. Thank you
unit test.

ChangeLog
plugins/elements/gstfilesrc.c

index 2a83875..caf1775 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-27  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * plugins/elements/gstfilesrc.c: (gst_file_src_create_read):
+         Requesting 0 bytes before the end of the file should result in
+         FLOW_OK and an empty buffer, not FLOW_UNEXPECTED. Thank you
+         unit test.
+
 2006-07-27  Wim Taymans  <wim@fluendo.com>
 
        * gst/gstcaps.c: (gst_static_caps_get), (gst_caps_get_structure):
index 8fc1ff0..5010175 100644 (file)
@@ -792,8 +792,8 @@ gst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length,
   if (G_UNLIKELY ((guint) ret < length && src->is_regular))
     goto unexpected_eos;
 
-  /* other files should eos if they read 0 */
-  if (G_UNLIKELY (ret == 0))
+  /* other files should eos if they read 0 and more was requested */
+  if (G_UNLIKELY (ret == 0 && length > 0))
     goto eos;
 
   length = ret;