diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-05-30 18:17:17 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-05-30 16:31:28 +0000 |
commit | 9f0419d376d25d738539bac2b55197abe226a6ce (patch) | |
tree | cd3059fd9df56c2e6aa638f81883bf9185a44d43 | |
parent | 13e4f777c763e22a260638445d7395687d787b54 (diff) |
make local time offset filterable
Change-Id: Icccc07706287df4b6a7481108f9921b939aae2d5
Reviewed-on: https://code.wireshark.org/review/1886
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
-rw-r--r-- | epan/dissectors/packet-mpeg-descriptor.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c index 85d782fa68..a610c970c5 100644 --- a/epan/dissectors/packet-mpeg-descriptor.c +++ b/epan/dissectors/packet-mpeg-descriptor.c @@ -1726,7 +1726,8 @@ proto_mpeg_descriptor_dissect_local_time_offset(tvbuff_t *tvb, guint offset, gui { guint end = offset + len; guint16 time_offset; - nstime_t time_of_change; + guint8 hour, min; + nstime_t local_time_offset, time_of_change; while (offset < end) { proto_tree_add_item(tree, hf_mpeg_descr_local_time_offset_country_code, tvb, offset, 3, ENC_ASCII|ENC_NA); @@ -1737,11 +1738,12 @@ proto_mpeg_descriptor_dissect_local_time_offset(tvbuff_t *tvb, guint offset, gui proto_tree_add_item(tree, hf_mpeg_descr_local_time_offset_polarity, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - time_offset = tvb_get_ntohs(tvb, offset); - proto_tree_add_string_format_value(tree, hf_mpeg_descr_local_time_offset_offset, tvb, offset, 2, - "Local Time Offset", "%02u:%02u", - MPEG_SECT_BCD44_TO_DEC(time_offset >> 8), - MPEG_SECT_BCD44_TO_DEC(time_offset)); + hour = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset)); + min = MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset+1)); + nstime_set_zero(&local_time_offset); + local_time_offset.secs = hour*60*60 + min*60; + proto_tree_add_time_format_value(tree, hf_mpeg_descr_local_time_offset_offset, + tvb, offset, 2, &local_time_offset, "%02d:%02d", hour, min); offset += 2; @@ -3754,8 +3756,8 @@ proto_register_mpeg_descriptor(void) } }, { &hf_mpeg_descr_local_time_offset_offset, { - "Time Offset", "mpeg_descr.local_time_offset.offset", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL + "Local Time Offset", "mpeg_descr.local_time_offset.offset", + FT_RELATIVE_TIME, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mpeg_descr_local_time_offset_time_of_change, { |