summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/elements/gstdisksrc.c10
-rw-r--r--gst/gstelement.c3
-rw-r--r--gst/gstpad.c3
-rw-r--r--gst/gstparse.c4
-rw-r--r--gst/gstparse.h2
-rw-r--r--gst/gstscheduler.c2
-rw-r--r--plugins/elements/gstdisksrc.c10
7 files changed, 24 insertions, 10 deletions
diff --git a/gst/elements/gstdisksrc.c b/gst/elements/gstdisksrc.c
index 9431e56810..694d3e39f0 100644
--- a/gst/elements/gstdisksrc.c
+++ b/gst/elements/gstdisksrc.c
@@ -229,8 +229,10 @@ gst_disksrc_get (GstPad *pad)
src = GST_DISKSRC (gst_pad_get_parent (pad));
g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), NULL);
+
/* deal with EOF state */
if (src->curoffset >= src->size) {
+ GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_set_eos (pad);
return NULL;
}
@@ -292,8 +294,12 @@ gst_disksrc_get_region (GstPad *pad, GstRegionType type,guint64 offset,guint64 l
/* deal with EOF state */
if (offset >= src->size) {
- gst_pad_set_eos (pad);
- return NULL;
+ //gst_pad_set_eos (pad);
+ GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
+ //FIXME
+ buf = gst_buffer_new();
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
+ return buf;
}
/* create the buffer */
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 52775adba6..2d4aa9aaea 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -649,7 +649,8 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
templ = gst_element_get_padtemplate_by_name (element, name);
- g_return_val_if_fail (templ != NULL, NULL);
+ if (templ == NULL)
+ return NULL;
pad = gst_element_request_pad (element, templ);
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 0240f464a7..0ea2a3b6b5 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -1544,7 +1544,8 @@ gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset, guint64 len
break;
}
}
- while (!(GST_BUFFER_OFFSET (result) == offset &&
+ while (result && ! GST_BUFFER_FLAG_IS_SET (result, GST_BUFFER_EOS)
+ && !(GST_BUFFER_OFFSET (result) == offset &&
GST_BUFFER_SIZE (result) == len));
return result;
diff --git a/gst/gstparse.c b/gst/gstparse.c
index 7c8e5ce897..78143993b2 100644
--- a/gst/gstparse.c
+++ b/gst/gstparse.c
@@ -24,6 +24,8 @@
#define DEBUG_NOPREFIX(format,args...)
#define VERBOSE(format,args...)
+#define GST_PARSE_LISTPAD(list) ((GstPad*)(list->data))
+
#include <string.h>
#include "gst_private.h"
@@ -333,7 +335,7 @@ gst_parse_launch_cmdline(int argc,char *argv[],GstBin *parent,gst_parse_priv *pr
if (!sinkpads) GST_DEBUG(0,"can't find a sink pad for %s\n", gst_element_get_name (previous));
else GST_DEBUG(0,"have sink pad %s:%s\n",GST_DEBUG_PAD_NAME(GST_PARSE_LISTPAD(sinkpads)));
- if (!srcpads && sinkpads) {
+ if (!srcpads && sinkpads && previous) {
dyn_connect *connect = g_malloc (sizeof (dyn_connect));
connect->srcpadname = srcpadname;
diff --git a/gst/gstparse.h b/gst/gstparse.h
index 77424345d0..ff77704819 100644
--- a/gst/gstparse.h
+++ b/gst/gstparse.h
@@ -25,8 +25,6 @@
#include <gst/gstbin.h>
-#define GST_PARSE_LISTPAD(list) ((GstPad*)(list->data))
-
gint gst_parse_launch (const gchar *cmdline, GstBin *parent);
#endif /* __GST_PARSE_H__ */
diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c
index 9a3e3f1348..ad23a17cdf 100644
--- a/gst/gstscheduler.c
+++ b/gst/gstscheduler.c
@@ -116,7 +116,7 @@ gst_schedule_src_wrapper (int argc,char *argv[])
}
GST_DEBUG (GST_CAT_DATAFLOW,"calling gst_pad_push on pad %s:%s\n",GST_DEBUG_PAD_NAME(realpad));
- if (buf) gst_pad_push ((GstPad*)realpad, buf);
+ gst_pad_push ((GstPad*)realpad, buf);
}
}
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
diff --git a/plugins/elements/gstdisksrc.c b/plugins/elements/gstdisksrc.c
index 9431e56810..694d3e39f0 100644
--- a/plugins/elements/gstdisksrc.c
+++ b/plugins/elements/gstdisksrc.c
@@ -229,8 +229,10 @@ gst_disksrc_get (GstPad *pad)
src = GST_DISKSRC (gst_pad_get_parent (pad));
g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), NULL);
+
/* deal with EOF state */
if (src->curoffset >= src->size) {
+ GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_set_eos (pad);
return NULL;
}
@@ -292,8 +294,12 @@ gst_disksrc_get_region (GstPad *pad, GstRegionType type,guint64 offset,guint64 l
/* deal with EOF state */
if (offset >= src->size) {
- gst_pad_set_eos (pad);
- return NULL;
+ //gst_pad_set_eos (pad);
+ GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
+ //FIXME
+ buf = gst_buffer_new();
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
+ return buf;
}
/* create the buffer */