static gboolean gst_tag_demux_pad_query (GstPad * pad, GstQuery * query);
static const GstQueryType *gst_tag_demux_get_query_types (GstPad * pad);
static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux);
+static void gst_tag_demux_send_pending_events (GstTagDemux * tagdemux);
static void gst_tag_demux_send_tag_event (GstTagDemux * tagdemux);
static gboolean gst_tag_demux_send_new_segment (GstTagDemux * tagdemux);
return GST_FLOW_UNEXPECTED;
}
if (outbuf) {
- GList *events;
-
if (G_UNLIKELY (demux->priv->srcpad == NULL)) {
gst_buffer_unref (outbuf);
return GST_FLOW_ERROR;
}
/* send any pending events we cached */
- GST_OBJECT_LOCK (demux);
- events = demux->priv->pending_events;
- demux->priv->pending_events = NULL;
- GST_OBJECT_UNLOCK (demux);
-
- while (events != NULL) {
- GST_DEBUG_OBJECT (demux->priv->srcpad, "sending cached %s event: %"
- GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (events->data), events->data);
- gst_pad_push_event (demux->priv->srcpad, GST_EVENT (events->data));
- events = g_list_delete_link (events, events);
- }
+ gst_tag_demux_send_pending_events (demux);
/* Send our own pending tag event */
if (demux->priv->send_tag_event) {
{
GstTagDemux *demux = GST_TAG_DEMUX (GST_PAD_PARENT (srcpad));
+ /* downstream in pull mode won't miss a newsegment event,
+ * but it likely appreciates other (tag) events */
+ if (demux->priv->need_newseg) {
+ gst_tag_demux_send_pending_events (demux);
+ demux->priv->need_newseg = FALSE;
+ }
+
if (demux->priv->send_tag_event) {
gst_tag_demux_send_tag_event (demux);
demux->priv->send_tag_event = FALSE;
return types;
}
+static void
+gst_tag_demux_send_pending_events (GstTagDemux * demux)
+{
+ GList *events;
+
+ /* send any pending events we cached */
+ GST_OBJECT_LOCK (demux);
+ events = demux->priv->pending_events;
+ demux->priv->pending_events = NULL;
+ GST_OBJECT_UNLOCK (demux);
+
+ while (events != NULL) {
+ GST_DEBUG_OBJECT (demux->priv->srcpad, "sending cached %s event: %"
+ GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (events->data), events->data);
+ gst_pad_push_event (demux->priv->srcpad, GST_EVENT (events->data));
+ events = g_list_delete_link (events, events);
+ }
+}
+
static void
gst_tag_demux_send_tag_event (GstTagDemux * demux)
{