From: Olivier CrĂȘte Date: Wed, 3 Nov 2010 22:02:49 +0000 (-0400) Subject: pcapparse: Send error GstMessage if stream doesn't have the expected magic X-Git-Tag: 1.19.3~507^2~16235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec16c22f54fc6ac177b317bbe3940527869d12d6;p=platform%2Fupstream%2Fgstreamer.git pcapparse: Send error GstMessage if stream doesn't have the expected magic --- diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c index b3a3450469..401e20f83e 100644 --- a/gst/pcapparse/gstpcapparse.c +++ b/gst/pcapparse/gstpcapparse.c @@ -41,7 +41,7 @@ */ #ifdef HAVE_CONFIG_H -# include +#include #endif #include "gstpcapparse.h" @@ -483,8 +483,11 @@ gst_pcap_parse_chain (GstPad * pad, GstBuffer * buffer) self->swap_endian = FALSE; else if (magic == 0xd4c3b2a1) self->swap_endian = TRUE; - else + else { + GST_ELEMENT_ERROR (self, STREAM, WRONG_TYPE, (NULL), + ("File is not a libpcap file version 2, magic is %X", magic)); ret = GST_FLOW_ERROR; + } if (ret == GST_FLOW_OK) self->initialized = TRUE;