diff options
author | Edward Hervey <edward@collabora.com> | 2013-08-19 17:23:28 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2013-08-20 10:16:00 +0200 |
commit | ce81c4eb48b546ae78e2caa8ed09860d35ed105e (patch) | |
tree | 3b0d8c5ded32a1fa7701c6bd4a64c53f54784e48 | |
parent | 1648c0ba6a26ee8665ff94f31e5b2df750cdc2ea (diff) |
jpegparse: Forward segment event after caps
Store it until we know what our caps are.
-rw-r--r-- | gst/jpegformat/gstjpegparse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c index e4bc2bfaf..9983f32d5 100644 --- a/gst/jpegformat/gstjpegparse.c +++ b/gst/jpegformat/gstjpegparse.c @@ -92,6 +92,7 @@ struct _GstJpegParsePrivate /* a new segment arrived */ gboolean new_segment; + GstSegment segment; /* the parsed frame size */ guint16 width, height; @@ -859,6 +860,8 @@ gst_jpeg_parse_push_buffer (GstJpegParse * parse, guint len) ("Can't set caps to the src pad"), ("Can't set caps to the src pad")); return GST_FLOW_ERROR; } + gst_pad_push_event (parse->priv->srcpad, + gst_event_new_segment (&parse->priv->segment)); if (parse->priv->tags) { GST_DEBUG_OBJECT (parse, "Pushing tags: %" GST_PTR_FORMAT, @@ -975,7 +978,8 @@ gst_jpeg_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) /* Discard any data in the adapter. There should have been an EOS before * to flush it. */ gst_adapter_clear (parse->priv->adapter); - res = gst_pad_push_event (parse->priv->srcpad, event); + gst_event_copy_segment (event, &parse->priv->segment); + gst_event_unref (event); parse->priv->new_segment = TRUE; break; case GST_EVENT_TAG:{ @@ -1024,6 +1028,7 @@ gst_jpeg_parse_change_state (GstElement * element, GstStateChange transition) parse->priv->caps_width = parse->priv->caps_height = -1; parse->priv->new_segment = FALSE; + gst_segment_init (&parse->priv->segment, GST_FORMAT_UNDEFINED); parse->priv->next_ts = GST_CLOCK_TIME_NONE; parse->priv->duration = GST_CLOCK_TIME_NONE; |