aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mpeg-pmt.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-07-25 20:42:16 +0000
committerBill Meier <wmeier@newsguy.com>2012-07-25 20:42:16 +0000
commit840a58f1f36f9b268a16e42f5227223f6f853777 (patch)
treecfd21b9285b62df4721d27303db606859763cc36 /epan/dissectors/packet-mpeg-pmt.c
parentb53d5078d902b453db61959cbc92205c7130d4ab (diff)
Minor cleanup:
- Create/use extended value string to access value string array; - col_clear() not needed; - Remove some unneeded initializers. svn path=/trunk/; revision=44012
Diffstat (limited to 'epan/dissectors/packet-mpeg-pmt.c')
-rw-r--r--epan/dissectors/packet-mpeg-pmt.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/epan/dissectors/packet-mpeg-pmt.c b/epan/dissectors/packet-mpeg-pmt.c
index 6270b31dc6..0af034f8c4 100644
--- a/epan/dissectors/packet-mpeg-pmt.c
+++ b/epan/dissectors/packet-mpeg-pmt.c
@@ -117,22 +117,23 @@ static const value_string mpeg_pmt_stream_type_vals[] = {
{ 0xC0, "ETV-AM EISS Signaling" },
{ 0x00, NULL }
};
+static value_string_ext mpeg_pmt_stream_type_vals_ext = VALUE_STRING_EXT_INIT(mpeg_pmt_stream_type_vals);
static void
dissect_mpeg_pmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- guint offset = 0, length = 0, descriptor_end = 0;
- guint16 prog_info_len = 0, es_info_len = 0, pid = 0;
+ guint offset = 0, length = 0;
+ guint descriptor_end, prog_info_len, es_info_len;
+ guint16 pid;
- proto_item *ti = NULL;
- proto_tree *mpeg_pmt_tree = NULL;
- proto_item *si = NULL;
- proto_tree *mpeg_pmt_stream_tree = NULL;
+ proto_item *ti;
+ proto_tree *mpeg_pmt_tree;
+ proto_item *si;
+ proto_tree *mpeg_pmt_stream_tree;
/* The TVB should start right after the section_length in the Section packet */
- col_clear(pinfo->cinfo, COL_INFO);
col_set_str(pinfo->cinfo, COL_INFO, "Program Map Table (PMT)");
if (!tree)
@@ -179,15 +180,15 @@ dissect_mpeg_pmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
si = proto_tree_add_text(mpeg_pmt_tree, tvb, offset, 5 + es_info_len, "Stream PID=0x%04hx", pid);
mpeg_pmt_stream_tree = proto_item_add_subtree(si, ett_mpeg_pmt_stream);
- proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_elementary_pid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_elementary_pid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_es_info_length, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mpeg_pmt_stream_tree, hf_mpeg_pmt_stream_es_info_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
descriptor_end = offset + es_info_len;
@@ -259,7 +260,7 @@ proto_register_mpeg_pmt(void)
{ &hf_mpeg_pmt_stream_type, {
"Stream type", "mpeg_pmt.stream.type",
- FT_UINT8, BASE_HEX, VALS(mpeg_pmt_stream_type_vals), 0, NULL, HFILL
+ FT_UINT8, BASE_HEX | BASE_EXT_STRING, &mpeg_pmt_stream_type_vals_ext, 0, NULL, HFILL
} },
{ &hf_mpeg_pmt_stream_reserved1, {