aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtp.c
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2016-12-09 15:43:30 +0100
committerMichael Mann <mmann78@netscape.net>2016-12-09 18:21:00 +0000
commit29841933f934533cc63ff218bf0f6423ee51a7eb (patch)
treeba707e9b1f178dbd2e1b75ef4c57ecc94c848930 /epan/dissectors/packet-rtp.c
parent2d89c34e8cf11d7cb51bd609eb18db3acffc1108 (diff)
[RTP] Don't call p_get_proto_data() twice
Change-Id: Ie13e23232e183818b813e391274d75415b3fee83 Reviewed-on: https://code.wireshark.org/review/19181 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r--epan/dissectors/packet-rtp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 1cd6cab66e..b61a5b5b49 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -297,7 +297,7 @@ void proto_reg_handoff_pkt_ccc(void);
static gint dissect_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data);
static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static void get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info);
+static struct _rtp_conversation_info *get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info);
/* Preferences bool to control whether or not setup info should be shown */
static gboolean global_rtp_show_setup_info = TRUE;
@@ -2109,8 +2109,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
/* Look for conv and add to the frame if found */
- get_conv_info(pinfo, rtp_info);
- p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, 0);
+ p_conv_data = get_conv_info(pinfo, rtp_info);
if (p_conv_data)
rtp_info->info_is_video = p_conv_data->is_video;
@@ -2120,10 +2119,8 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
col_set_str( pinfo->cinfo, COL_PROTOCOL, (is_srtp) ? "SRTP" : "RTP" );
- /* check if this is added as an SRTP stream - if so, don't try to dissect the payload data for now */
- p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtp, 0);
-
#if 0 /* XXX: srtp_offset never actually used ?? */
+ /* check if this is added as an SRTP stream - if so, don't try to dissect the payload data for now */
if (p_conv_data && p_conv_data->srtp_info) {
srtp_info = p_conv_data->srtp_info;
if (rtp_info->info_all_data_present) {
@@ -2631,7 +2628,7 @@ calculate_extended_seqno(guint32 previous_seqno, guint16 raw_seqno)
}
/* Look for conversation info */
-static void
+static struct _rtp_conversation_info *
get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
{
/* Conversation and current data */
@@ -2681,7 +2678,10 @@ get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
}
}
}
- if (p_conv_data) rtp_info->info_setup_frame_num = p_conv_data->frame_number;
+ if (p_conv_data) {
+ rtp_info->info_setup_frame_num = p_conv_data->frame_number;
+ }
+ return p_conv_data;
}