summaryrefslogtreecommitdiffstats
path: root/gst/multifile/gstmultifilesrc.c
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2007-12-17 21:12:28 +0000
committerDavid Schleef <ds@schleef.org>2007-12-17 21:12:28 +0000
commit45e90efd1b3f19b231fd4e4cc753e2870aa62d0a (patch)
treef0bbf863e1f6013f1f856cb31f5121de5293f4bb /gst/multifile/gstmultifilesrc.c
parentd9cf6cc948a56e3524e53a6a43e869d9eb894bce (diff)
downloadgst-plugins-bad-45e90efd1b3f19b231fd4e4cc753e2870aa62d0a.tar.gz
gst-plugins-bad-45e90efd1b3f19b231fd4e4cc753e2870aa62d0a.tar.bz2
gst-plugins-bad-45e90efd1b3f19b231fd4e4cc753e2870aa62d0a.zip
gst/multifile/gstmultifilesrc.*: When subsequent files are read, if the file doesn't exist, send an EOS instead of ca...
Original commit message from CVS: * gst/multifile/gstmultifilesrc.c: * gst/multifile/gstmultifilesrc.h: When subsequent files are read, if the file doesn't exist, send an EOS instead of causing an error.
Diffstat (limited to 'gst/multifile/gstmultifilesrc.c')
-rw-r--r--gst/multifile/gstmultifilesrc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c
index f347257c..35ded484 100644
--- a/gst/multifile/gstmultifilesrc.c
+++ b/gst/multifile/gstmultifilesrc.c
@@ -155,6 +155,7 @@ gst_multi_file_src_init (GstMultiFileSrc * multifilesrc,
multifilesrc->index = DEFAULT_INDEX;
multifilesrc->filename = g_strdup (DEFAULT_LOCATION);
+ multifilesrc->successful_read = FALSE;
}
static void
@@ -279,7 +280,13 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
file = fopen (filename, "rb");
if (!file) {
- goto handle_error;
+ if (multifilesrc->successful_read) {
+ /* If we've read at least one buffer successfully, not finding the
+ * next file is EOS. */
+ return GST_FLOW_UNEXPECTED;
+ } else {
+ goto handle_error;
+ }
}
fseek (file, 0, SEEK_END);
@@ -293,6 +300,7 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
goto handle_error;
}
+ multifilesrc->successful_read = TRUE;
multifilesrc->index++;
GST_BUFFER_SIZE (buf) = size;