From d24ba074b7d6758eade301a59ff38664675fcb15 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 6 Oct 2006 12:57:10 +0000 Subject: [PATCH] ext/theora/theoradec.c: Zero byte theora packets are valid and well-defined; don't warn on them. Original commit message from CVS: * ext/theora/theoradec.c: (theora_dec_chain): Zero byte theora packets are valid and well-defined; don't warn on them. --- ChangeLog | 6 ++++++ ext/theora/theoradec.c | 20 +++++--------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2f708d62f..a8f6fb064a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-06 Michael Smith + + * ext/theora/theoradec.c: (theora_dec_chain): + Zero byte theora packets are valid and well-defined; don't warn on + them. + 2006-10-06 Thomas Vander Stichele * gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_class_init), diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index eba33c4c9d..a233579115 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -1189,14 +1189,13 @@ theora_dec_chain (GstPad * pad, GstBuffer * buf) dec->last_timestamp = -1; } - if (packet.bytes < 1) - goto wrong_size; - GST_DEBUG_OBJECT (dec, "header=%02x packetno=%lld, outtime=%" GST_TIME_FORMAT, - packet.packet[0], packet.packetno, GST_TIME_ARGS (dec->last_timestamp)); + packet.bytes ? packet.packet[0] : -1, packet.packetno, + GST_TIME_ARGS (dec->last_timestamp)); - /* switch depending on packet type */ - if (packet.packet[0] & 0x80) { + /* switch depending on packet type. A zero byte packet is always a data + * packet; we don't dereference it in that case. */ + if (packet.bytes && packet.packet[0] & 0x80) { if (dec->have_header) { GST_WARNING_OBJECT (GST_OBJECT (dec), "Ignoring header"); goto done; @@ -1215,15 +1214,6 @@ done: gst_buffer_unref (buf); return result; - - /* ERRORS */ -wrong_size: - { - GST_WARNING_OBJECT (dec, "received empty packet"); - dec->discont = TRUE; - result = GST_FLOW_OK; - goto done; - } } static GstStateChangeReturn