summaryrefslogtreecommitdiff
path: root/ui/gtk/rtp_player.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-04 21:40:05 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-05 13:55:04 +0000
commit22b4ec91c006fec65e655ccbb0dbbc32438f820b (patch)
tree033dc9de28b8a79550a4dd769fcfb249df4be38c /ui/gtk/rtp_player.c
parent9a7318a184e25e08d1c8449e3f826e0a5c66ca3b (diff)
downloadwireshark-22b4ec91c006fec65e655ccbb0dbbc32438f820b.tar.gz
Replace ep_display_to_address with wmem equivalent display_to_address.
Almost all instances require using "manual" memory management, but it gets some ep_ calls out of the GUI. Change-Id: Ifa7303766b08d09442ccf3d7063cbe061578ecd9 Reviewed-on: https://code.wireshark.org/review/6318 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/gtk/rtp_player.c')
-rw-r--r--ui/gtk/rtp_player.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/ui/gtk/rtp_player.c b/ui/gtk/rtp_player.c
index bbb44f81cc..3b2886ef55 100644
--- a/ui/gtk/rtp_player.c
+++ b/ui/gtk/rtp_player.c
@@ -352,8 +352,8 @@ add_rtp_packet(const struct _rtp_info *rtp_info, packet_info *pinfo)
* uses: src_ip:src_port dst_ip:dst_port ssrc
*/
key_str = g_string_new("");
- g_string_printf(key_str, "%s:%d %s:%d %d", ep_address_to_display(&(pinfo->src)),
- pinfo->srcport, ep_address_to_display(&(pinfo->dst)),
+ g_string_printf(key_str, "%s:%d %s:%d %d", address_to_display(pinfo->pool, &(pinfo->src)),
+ pinfo->srcport, address_to_display(pinfo->pool, &(pinfo->dst)),
pinfo->destport, rtp_info->info_sync_src );
/* lookup for this RTP packet in the stream hash table */
@@ -548,6 +548,7 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr)
double mean_delay;
double variation;
#endif
+ char *src_addr, *dst_addr;
int decoded_bytes;
int decoded_bytes_prev;
@@ -580,9 +581,13 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr)
* uses: src_ip:src_port dst_ip:dst_port call_num
*/
key_str = g_string_new("");
- g_string_printf(key_str, "%s:%d %s:%d %d %u", ep_address_to_display(&(rsi->src_addr)),
- rsi->src_port, ep_address_to_display(&(rsi->dest_addr)),
+ src_addr = (char*)address_to_display(NULL, &(rsi->src_addr));
+ dst_addr = (char*)address_to_display(NULL, &(rsi->dest_addr));
+ g_string_printf(key_str, "%s:%d %s:%d %d %u", src_addr,
+ rsi->src_port, dst_addr,
rsi->dest_port, rsi->call_num, info->current_channel);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
/* create the rtp_channels_hash table if it doesn't exist */
if (!rtp_channels_hash) {
@@ -1760,7 +1765,7 @@ add_channel_to_window(gchar *key _U_ , rtp_channel_info_t *rci, guint *counter _
{
GString *label;
GtkWidget *viewport;
-
+ char *src_addr, *dst_addr;
/* create the channel draw area */
rci->draw_area=gtk_drawing_area_new();
@@ -1797,22 +1802,26 @@ add_channel_to_window(gchar *key _U_ , rtp_channel_info_t *rci, guint *counter _
label = g_string_new("");
+ src_addr = (char*)address_to_display(NULL, &(rci->first_stream->src_addr));
+ dst_addr = (char*)address_to_display(NULL, &(rci->first_stream->dest_addr));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb_use_rtp_timestamp))) {
g_string_printf(label, "From %s:%d to %s:%d Duration:%.2f Out of Seq: %d(%.1f%%) Wrong Timestamp: %d(%.1f%%)",
- ep_address_to_display(&(rci->first_stream->src_addr)), rci->first_stream->src_port,
- ep_address_to_display(&(rci->first_stream->dest_addr)), rci->first_stream->dest_port,
+ src_addr, rci->first_stream->src_port,
+ dst_addr, rci->first_stream->dest_port,
(double)rci->samples->len/sample_rate,
rci->out_of_seq, (double)rci->out_of_seq * 100 / (double)rci->num_packets,
rci->wrong_timestamp, (double)rci->wrong_timestamp * 100 / (double)rci->num_packets);
} else {
g_string_printf(label, "From %s:%d to %s:%d Duration:%.2f Drop by Jitter Buff:%d(%.1f%%) Out of Seq: %d(%.1f%%) Wrong Timestamp: %d(%.1f%%)",
- ep_address_to_display(&(rci->first_stream->src_addr)), rci->first_stream->src_port,
- ep_address_to_display(&(rci->first_stream->dest_addr)), rci->first_stream->dest_port,
+ src_addr, rci->first_stream->src_port,
+ dst_addr, rci->first_stream->dest_port,
(double)rci->samples->len/sample_rate,
rci->drop_by_jitter_buff, (double)rci->drop_by_jitter_buff * 100 / (double)rci->num_packets,
rci->out_of_seq, (double)rci->out_of_seq * 100 / (double)rci->num_packets,
rci->wrong_timestamp, (double)rci->wrong_timestamp * 100 / (double)rci->num_packets);
}
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
rci->check_bt = gtk_check_button_new_with_label(label->str);
gtk_box_pack_start(GTK_BOX (channels_vb), rci->check_bt, FALSE, FALSE, 1);