Commit 869e45d1 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸 Committed by Sebastian Dröge

gdkpixbufdec: always output a TIME segment

It makes no sense for a decoder to output a BYTES segment, and
many elements one would plug downstream of a video decoder assume
the segments they receive are in TIME format, for example this fixes:

gst-validate-1.0 filesrc location=opacity01.svg ! gdkpixbufdec ! \
videobalance ! videoconvert ! fakesink

In that case, videobalance was emitting an assertion when trying to
call gst_object_sync_values()
parent e9b5e78c
......@@ -431,11 +431,23 @@ gst_gdk_pixbuf_dec_sink_event (GstPad * pad, GstObject * parent,
const GstSegment *segment;
GstSegment output_segment;
guint32 seqnum;
gst_event_parse_segment (event, &segment);
if (segment->format == GST_FORMAT_BYTES)
pixbuf->packetized = FALSE;
pixbuf->packetized = TRUE;
if (segment->format != GST_FORMAT_TIME) {
seqnum = gst_event_get_seqnum (event);
gst_event_unref (event);
gst_segment_init (&output_segment, GST_FORMAT_TIME);
event = gst_event_new_segment (&output_segment);
gst_event_set_seqnum (event, seqnum);
if (pixbuf->pixbuf_loader != NULL) {
gdk_pixbuf_loader_close (pixbuf->pixbuf_loader, NULL);
g_object_unref (G_OBJECT (pixbuf->pixbuf_loader));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment