aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mp2t.c18
-rw-r--r--epan/dissectors/packet-mpeg-pes.c9
2 files changed, 19 insertions, 8 deletions
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index 967e991ed6..5b6edb556d 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -40,8 +40,12 @@
/* The MPEG2 TS packet size */
#define MP2T_PACKET_SIZE 188
+static dissector_handle_t pes_handle;
+
static int proto_mp2t = -1;
static gint ett_mp2t = -1;
+static gint ett_mp2t_header = -1;
+static gint ett_mp2t_af = -1;
static int hf_mp2t_header = -1;
static int hf_mp2t_sync_byte = -1;
@@ -204,7 +208,7 @@ dissect_tsp( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tre
hi = proto_tree_add_item( mp2t_tree, hf_mp2t_header, tvb, offset, 4, FALSE);
- mp2t_header_tree = proto_item_add_subtree( hi, ett_mp2t );
+ mp2t_header_tree = proto_item_add_subtree( hi, ett_mp2t_header );
proto_tree_add_item( mp2t_header_tree, hf_mp2t_sync_byte, tvb, offset, 4, FALSE);
proto_tree_add_item( mp2t_header_tree, hf_mp2t_tei, tvb, offset, 4, FALSE);
@@ -233,7 +237,7 @@ dissect_tsp( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tre
offset += 1;
hi = proto_tree_add_item( mp2t_tree, hf_mp2t_af, tvb, offset, af_length, FALSE);
- mp2t_af_tree = proto_item_add_subtree( hi, ett_mp2t );
+ mp2t_af_tree = proto_item_add_subtree( hi, ett_mp2t_af );
af_flags = tvb_get_guint8(tvb, offset);
@@ -399,7 +403,11 @@ dissect_tsp( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tre
proto_tree_add_item( mp2t_tree, hf_mp2t_malformed_payload, tvb, offset, payload_len, FALSE);
offset += payload_len;
} else {
- proto_tree_add_item( mp2t_tree, hf_mp2t_payload, tvb, offset, payload_len, FALSE);
+ if (tvb_get_ntoh24(tvb, offset) == 0x000001) {
+ tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, payload_len, payload_len);
+ call_dissector(pes_handle, next_tvb, pinfo, mp2t_tree);
+ } else
+ proto_tree_add_item( mp2t_tree, hf_mp2t_payload, tvb, offset, payload_len, FALSE);
offset += payload_len;
}
}
@@ -605,6 +613,8 @@ proto_register_mp2t(void)
static gint *ett[] =
{
&ett_mp2t,
+ &ett_mp2t_header,
+ &ett_mp2t_af,
};
proto_mp2t = proto_register_protocol("ISO/IEC 13818-1", "MP2T", "mp2t");
@@ -621,5 +631,7 @@ proto_reg_handoff_mp2t(void)
mp2t_handle = create_dissector_handle(dissect_mp2t, proto_mp2t);
dissector_add("rtp.pt", PT_MP2T, mp2t_handle);
+
+ pes_handle = find_dissector("mpeg-pes");
}
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 95c45bd74e..b25bbe7717 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -733,7 +733,7 @@ dissect_mpeg_pes_pack_header(tvbuff_t *tvb, unsigned offset,
return offset;
}
-void
+static void
dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static gboolean
@@ -885,7 +885,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static heur_dissector_list_t heur_subdissector_list;
-void
+static void
dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
@@ -1210,15 +1210,14 @@ proto_register_mpeg_pes(void)
proto_mpeg = proto_register_protocol(
"Moving Picture Experts Group", "MPEG", "mpeg");
+ register_dissector("mpeg", dissect_mpeg, proto_mpeg);
register_heur_dissector_list("mpeg", &heur_subdissector_list);
- if (proto_mpeg_pes != -1)
- return;
-
proto_mpeg_pes = proto_register_protocol(
"Packetized Elementary Stream", "MPEG PES", "mpeg-pes");
proto_register_field_array(proto_mpeg_pes, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ register_dissector("mpeg-pes", dissect_mpeg_pes, proto_mpeg_pes);
}
void