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()
This commit is contained in:
Mathieu Duponchelle 2019-01-17 21:06:54 +01:00 committed by Sebastian Dröge
parent e9b5e78c9e
commit 869e45d19c

View file

@ -431,11 +431,23 @@ gst_gdk_pixbuf_dec_sink_event (GstPad * pad, GstObject * parent,
case GST_EVENT_SEGMENT:
{
const GstSegment *segment;
GstSegment output_segment;
guint32 seqnum;
gst_event_parse_segment (event, &segment);
if (segment->format == GST_FORMAT_BYTES)
pixbuf->packetized = FALSE;
else
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));