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;
}
/* 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 */
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);
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;
#define DEBUG_NOPREFIX(format,args...)
#define VERBOSE(format,args...)
+#define GST_PARSE_LISTPAD(list) ((GstPad*)(list->data))
+
#include <string.h>
#include "gst_private.h"
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;
#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__ */
}
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));
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;
}
/* 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 */