summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2019-01-17 21:06:54 +0100
committerTim-Philipp Müller <tim@centricular.com>2019-05-06 23:43:07 +0200
commitcaf48e5c6f37beb950e3b26a62ab229cbb85d150 (patch)
treec478222ca271343a502c3352529a9d2eda29205d
parent3142b6e851a807cb09577a5d183318135c51e408 (diff)
downloadgstreamer-plugins-good-caf48e5c6f37beb950e3b26a62ab229cbb85d150.tar.gz
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()
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbufdec.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/gdk_pixbuf/gstgdkpixbufdec.c b/ext/gdk_pixbuf/gstgdkpixbufdec.c
index 09211bf17..c119236a8 100644
--- a/ext/gdk_pixbuf/gstgdkpixbufdec.c
+++ b/ext/gdk_pixbuf/gstgdkpixbufdec.c
@@ -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));