+2006-04-07 Wim Taymans <wim@fluendo.com>
+
+ * ext/theora/theoradec.c: (theora_dec_sink_event),
+ (theora_handle_data_packet), (theora_dec_chain):
+ Unref unhandled events.
+ Protect against empty buffers.
+ Perform QoS on running time.
+
2006-04-07 Michael Smith <msmith@fluendo.com>
* ext/vorbis/vorbisenc.c: (gst_vorbis_enc_set_header_on_caps),
ret = gst_pad_push_event (dec->srcpad, event);
break;
case GST_EVENT_FLUSH_STOP:
+ /* FIXME, makes us waiting for keyframes */
gst_theora_dec_reset (dec);
ret = gst_pad_push_event (dec->srcpad, event);
break;
newseg_wrong_format:
{
GST_DEBUG_OBJECT (dec, "received non TIME newsegment");
+ gst_event_unref (event);
goto done;
}
newseg_wrong_rate:
{
GST_DEBUG_OBJECT (dec, "negative rates not supported yet");
+ gst_event_unref (event);
goto done;
}
}
if (outtime != -1) {
gboolean need_skip;
+ GstClockTime qostime;
+
+ /* qos needs to be done on running time */
+ qostime = gst_segment_to_running_time (&dec->segment, GST_FORMAT_TIME,
+ outtime);
GST_OBJECT_LOCK (dec);
/* check for QoS, don't perform the last steps of getting and
* pushing the buffers that are known to be late. */
/* FIXME, we can also entirely skip decoding if the next valid buffer is
* known to be after a keyframe (using the granule_shift) */
- need_skip = dec->earliest_time != -1 && outtime <= dec->earliest_time;
+ need_skip = dec->earliest_time != -1 && qostime <= dec->earliest_time;
GST_OBJECT_UNLOCK (dec);
if (need_skip)
dec->last_timestamp = -1;
}
+ if (packet.bytes < 1)
+ goto wrong_size;
+
GST_DEBUG_OBJECT (dec, "header=%d packetno=%lld, outtime=%" GST_TIME_FORMAT,
packet.packet[0], packet.packetno, GST_TIME_ARGS (dec->last_timestamp));
gst_buffer_unref (buf);
return result;
+
+ /* ERRORS */
+wrong_size:
+ {
+ GST_WARNING_OBJECT (dec, "received empty packet");
+ result = GST_FLOW_OK;
+ goto done;
+ }
}
static GstStateChangeReturn