mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
pcapparse: Send error GstMessage if stream doesn't have the expected magic
This commit is contained in:
parent
891e08f220
commit
ec16c22f54
1 changed files with 5 additions and 2 deletions
|
@ -41,7 +41,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstpcapparse.h"
|
#include "gstpcapparse.h"
|
||||||
|
@ -483,8 +483,11 @@ gst_pcap_parse_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
self->swap_endian = FALSE;
|
self->swap_endian = FALSE;
|
||||||
else if (magic == 0xd4c3b2a1)
|
else if (magic == 0xd4c3b2a1)
|
||||||
self->swap_endian = TRUE;
|
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;
|
ret = GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == GST_FLOW_OK)
|
if (ret == GST_FLOW_OK)
|
||||||
self->initialized = TRUE;
|
self->initialized = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue