Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] [PATCH] wiretap: Add MPEG PES.

From: "Shaun Jackman" <sjackman@xxxxxxxxx>
Date: Sun, 5 Aug 2007 11:50:00 -0700
This patch adds MPEG PES (packetized elementary stream) to the list of
magic types in wiretap/mpeg.c.

Cheers,
Shaun

2007-08-05  Shaun Jackman  <sjackman@xxxxxxxxx>

	* wiretap/mpeg.c (magic): Add MPEG PES.

Index: wiretap/mpeg.c
===================================================================
--- wiretap/mpeg.c	(revision 22456)
+++ wiretap/mpeg.c	(working copy)
@@ -247,14 +247,15 @@
 	g_free(wth->capture.mpeg);
 }

-/* XXX We probably need more magic to open more types */
 struct _mpeg_magic {
 	size_t len;
 	const gchar* match;
 } magic[] = {
-	{3,"TAG"},
-	{3,"ID3"},
-	{0,NULL}
+	{ 3, "TAG" }, /* ID3v1 */
+	{ 3, "ID3" }, /* ID3v2 */
+	{ 3, "\0\0\1" }, /* MPEG PES */
+	/* XXX MPEG audio is missing. */
+	{ 0, NULL }
 };

 int
2007-08-05  Shaun Jackman  <sjackman@xxxxxxxxx>

	* wiretap/mpeg.c (magic): Add MPEG PES.

Index: wiretap/mpeg.c
===================================================================
--- wiretap/mpeg.c	(revision 22456)
+++ wiretap/mpeg.c	(working copy)
@@ -247,14 +247,15 @@
 	g_free(wth->capture.mpeg);
 }
 
-/* XXX We probably need more magic to open more types */
 struct _mpeg_magic {
 	size_t len;
 	const gchar* match;
 } magic[] = {
-	{3,"TAG"},
-	{3,"ID3"},
-	{0,NULL}
+	{ 3, "TAG" }, /* ID3v1 */
+	{ 3, "ID3" }, /* ID3v2 */
+	{ 3, "\0\0\1" }, /* MPEG PES */
+	/* XXX MPEG audio is missing. */
+	{ 0, NULL }
 };
 
 int