aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mpeg-descriptor.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-05-14 23:58:08 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-05-19 09:14:20 +0000
commit42220913c30b8d930b6d951d912f0cc3867e33ad (patch)
tree0bfaccdcfe4b0dbab5c478cf03cd6438bd2af4f5 /epan/dissectors/packet-mpeg-descriptor.c
parentd7bd2ecf9fc2c627d236484cee8e77e84697da07 (diff)
change the satellite frequency into a float (freq in GHz)
and make it filterable Change-Id: I0644e5c69ff58301c00ea3d37e80f25b856168e4 Reviewed-on: https://code.wireshark.org/review/1689 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-mpeg-descriptor.c')
-rw-r--r--epan/dissectors/packet-mpeg-descriptor.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c
index 1d96733852..a544c8b416 100644
--- a/epan/dissectors/packet-mpeg-descriptor.c
+++ b/epan/dissectors/packet-mpeg-descriptor.c
@@ -740,18 +740,17 @@ static void
proto_mpeg_descriptor_dissect_satellite_delivery(tvbuff_t *tvb, guint offset, proto_tree *tree)
{
- guint32 frequency, symbol_rate;
+ float frequency;
+ guint32 symbol_rate;
guint16 orbital_position;
guint8 modulation_system;
- frequency = tvb_get_ntohl(tvb, offset);
- proto_tree_add_string_format_value(tree, hf_mpeg_descr_satellite_delivery_frequency, tvb, offset, 4,
- "Frequency", "%2u%01u,%01u%02u%02u GHz",
- MPEG_SECT_BCD44_TO_DEC(frequency >> 24),
- MPEG_SECT_BCD44_TO_DEC(frequency >> 16) / 10,
- MPEG_SECT_BCD44_TO_DEC(frequency >> 16) % 10,
- MPEG_SECT_BCD44_TO_DEC(frequency >> 8),
- MPEG_SECT_BCD44_TO_DEC(frequency));
+ frequency = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)) * 10.0f +
+ MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+1)) / 10.0f +
+ MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+2)) / 1000.0f +
+ MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+3)) / 100000.f;
+ proto_tree_add_float_format_value(tree, hf_mpeg_descr_satellite_delivery_frequency,
+ tvb, offset, 4, frequency, "Frequency: %f GHz", frequency);
offset += 4;
orbital_position = tvb_get_ntohs(tvb, offset);
@@ -3283,7 +3282,7 @@ proto_register_mpeg_descriptor(void)
/* 0x43 Satellite Delivery System Descriptor */
{ &hf_mpeg_descr_satellite_delivery_frequency, {
"Frequency", "mpeg_descr.sat_delivery.freq",
- FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL
+ FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL
} },
{ &hf_mpeg_descr_satellite_delivery_orbital_position, {