*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#include <gst/gst.h>
GstPad *sinkpad, *srcpad;
guint64 offset;
+
+ gboolean need_newsegment;
};
struct _GstRndBufferSizeClass
res =
gst_pad_start_task (pad, (GstTaskFunction) gst_rnd_buffer_size_loop,
self);
+ self->need_newsegment = TRUE;
} else {
GST_INFO_OBJECT (self, "stopping pull");
res = gst_pad_stop_task (pad);
GST_WARNING_OBJECT (self, "short buffer: %u bytes", size);
}
+ if (self->need_newsegment) {
+ GstSegment segment;
+
+ gst_segment_init (&segment, GST_FORMAT_BYTES);
+ segment.start = self->offset;
+ gst_pad_push_event (self->srcpad, gst_event_new_segment (&segment));
+ self->need_newsegment = FALSE;
+ }
+
self->offset += size;
ret = gst_pad_push (self->srcpad, buf);