From 7ba7c58f992be6ad1447b79e8798689c116cc9a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 25 Apr 2016 17:16:04 +0300 Subject: [PATCH] smartencoder: Only accept TIME segments for real ... and don't try to push pending data without ever having received a SEGMENT event before EOS https://bugzilla.gnome.org/show_bug.cgi?id=765541 --- gst/encoding/gstsmartencoder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/encoding/gstsmartencoder.c b/gst/encoding/gstsmartencoder.c index 5daf6f9..a950edf 100644 --- a/gst/encoding/gstsmartencoder.c +++ b/gst/encoding/gstsmartencoder.c @@ -356,9 +356,12 @@ smart_encoder_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) GST_DEBUG_OBJECT (smart_encoder, "segment: %" GST_SEGMENT_FORMAT, smart_encoder->segment); - if (smart_encoder->segment->format != GST_FORMAT_TIME) + if (smart_encoder->segment->format != GST_FORMAT_TIME) { GST_ERROR ("smart_encoder can not handle streams not specified in GST_FORMAT_TIME"); + gst_event_unref (event); + return FALSE; + } /* And keep a copy for further usage */ if (smart_encoder->newsegment) @@ -368,7 +371,8 @@ smart_encoder_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) break; case GST_EVENT_EOS: GST_DEBUG ("Eos, flushing remaining data"); - gst_smart_encoder_push_pending_gop (smart_encoder); + if (smart_encoder->segment->format == GST_FORMAT_TIME) + gst_smart_encoder_push_pending_gop (smart_encoder); break; default: break; -- 2.7.4