From e3a64dc95072dc6f8e2b8e2dcf9c22773fdd9142 Mon Sep 17 00:00:00 2001 From: Kaian Date: Mon, 15 Feb 2016 12:20:19 +0100 Subject: [PATCH] cf: fix RTP arrows display crash --- src/curses/ui_call_flow.c | 6 +++++- src/setting.c | 2 +- src/setting.h | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/curses/ui_call_flow.c b/src/curses/ui_call_flow.c index 7d235d4..06889a3 100644 --- a/src/curses/ui_call_flow.c +++ b/src/curses/ui_call_flow.c @@ -342,7 +342,11 @@ call_flow_draw_arrow(ui_t *ui, call_flow_arrow_t *arrow, int line) if (arrow->type == CF_ARROW_SIP) { return call_flow_draw_message(ui, arrow, line); } else { - return call_flow_draw_rtp_stream(ui, arrow, line); + if (setting_enabled(SETTING_CF_MEDIA)) { + return call_flow_draw_rtp_stream(ui, arrow, line); + } else { + return 0; + } } } diff --git a/src/setting.c b/src/setting.c index b063e4c..9e2df0c 100644 --- a/src/setting.c +++ b/src/setting.c @@ -64,7 +64,7 @@ setting_t settings[SETTING_COUNT] = { { SETTING_CF_SCROLLSTEP, "cf.scrollstep", SETTING_FMT_NUMBER, "4", NULL }, { SETTING_CF_LOCALHIGHLIGHT, "cf.localhighlight", SETTING_FMT_ENUM, SETTING_ON, SETTING_ENUM_ONOFF }, { SETTING_CF_SDP_INFO, "cf.sdpinfo", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_SDP_INFO }, - { SETTING_CF_MEDIA, "cf.media", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_MEDIA }, + { SETTING_CF_MEDIA, "cf.media", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_ONOFF }, { SETTING_CF_DELTA, "cf.deltatime", SETTING_FMT_ENUM, SETTING_ON, SETTING_ENUM_ONOFF }, { SETTING_CR_SCROLLSTEP, "cr.scrollstep", SETTING_FMT_NUMBER, "10", NULL }, { SETTING_FILTER_METHODS, "filter.methods", SETTING_FMT_STRING, "", NULL }, diff --git a/src/setting.h b/src/setting.h index fcddd2e..9130a2d 100644 --- a/src/setting.h +++ b/src/setting.h @@ -56,7 +56,6 @@ typedef struct setting_option setting_t; #define SETTING_ENUM_SDP_INFO (const char *[]){ "off", "first", "full", "compressed", NULL} #define SETTING_ENUM_STORAGE (const char *[]){ "none", "memory", NULL } #define SETTING_ENUM_HEPVERSION (const char *[]){ "2", "3", NULL } -#define SETTING_ENUM_MEDIA (const char *[]){ "on", "off", "rtcp", NULL } //! Other useful defines #define SETTING_ON "on"