Adjust proto_tree_add_[float|double]_format_value calls to use unit string
[metze/wireshark/wip.git] / epan / dissectors / file-mp4.c
index bbf37fbdbec22d5f62e5abb61224d192b2ac746f..911a4bc70a31369e1eb505b1bf8b4c48188b9272 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "config.h"
 
+#include <math.h>
 
 #include <epan/packet.h>
 #include <epan/expert.h>
@@ -216,15 +217,13 @@ dissect_mp4_mvhd_body(tvbuff_t *tvb, gint offset, gint len _U_,
     rate = tvb_get_ntohs(tvb, offset);
     fract_dec = tvb_get_ntohs(tvb, offset+2);
     rate += make_fract(fract_dec);
-    proto_tree_add_double_format_value(tree, hf_mp4_mvhd_rate,
-            tvb, offset, 4, rate, "%f", rate);
+    proto_tree_add_double(tree, hf_mp4_mvhd_rate, tvb, offset, 4, rate);
     offset += 4;
 
     vol = tvb_get_guint8(tvb, offset);
     fract_dec = tvb_get_guint8(tvb, offset+1);
     vol += make_fract(fract_dec);
-    proto_tree_add_double_format_value(tree, hf_mp4_mvhd_vol,
-            tvb, offset, 4, vol, "%f", vol);
+    proto_tree_add_double(tree, hf_mp4_mvhd_vol, tvb, offset, 4, vol);
     offset += 2;
 
     offset += 2;   /* 16 bits reserved */
@@ -313,15 +312,13 @@ dissect_mp4_tkhd_body(tvbuff_t *tvb, gint offset, gint len _U_,
     width = tvb_get_ntohs(tvb, offset);
     fract_dec = tvb_get_ntohs(tvb, offset+2);
     width += make_fract(fract_dec);
-    proto_tree_add_double_format_value(tree, hf_mp4_tkhd_width,
-            tvb, offset, 4, width, "%f", width);
+    proto_tree_add_double(tree, hf_mp4_tkhd_width, tvb, offset, 4, width);
     offset += 4;
 
     height = tvb_get_ntohs(tvb, offset);
     fract_dec = tvb_get_ntohs(tvb, offset+2);
     height += make_fract(fract_dec);
-    proto_tree_add_double_format_value(tree, hf_mp4_tkhd_height,
-            tvb, offset, 4, height, "%f", height);
+    proto_tree_add_double(tree, hf_mp4_tkhd_height, tvb, offset, 4, height);
     offset += 4;
 
     return offset-offset_start;
@@ -490,7 +487,7 @@ dissect_mp4_url_body(tvbuff_t *tvb, gint offset, gint len,
 
 static gint
 dissect_mp4_stsd_body(tvbuff_t *tvb, gint offset, gint len,
-        packet_info *pinfo _U_, proto_tree *tree)
+        packet_info *pinfo, proto_tree *tree)
 {
     guint32  entry_cnt, i;
     gint     ret;
@@ -805,8 +802,9 @@ proto_register_mp4(void)
 void
 proto_reg_handoff_mp4(void)
 {
-    dissector_handle_t mp4_handle = new_create_dissector_handle(dissect_mp4, proto_mp4);
+    dissector_handle_t mp4_handle = create_dissector_handle(dissect_mp4, proto_mp4);
     dissector_add_string("media_type", "video/mp4", mp4_handle);
+    dissector_add_string("media_type", "audio/mp4", mp4_handle);
 }