diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index eab5cb708..09f92c098 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7387,11 +7387,13 @@ const char* linphone_transport_to_string(LinphoneTransportType transport) { LinphoneTransportType linphone_transport_parse(const char* transport) { return (LinphoneTransportType)sal_transport_parse(transport); } -const char *linphone_streamtype_to_string(const LinphoneStreamType type) { + +const char *linphone_stream_type_to_string(const LinphoneStreamType type) { switch (type) { case LinphoneStreamTypeAudio: return "LinphoneStreamTypeAudio"; case LinphoneStreamTypeVideo: return "LinphoneStreamTypeVideo"; case LinphoneStreamTypeText: return "LinphoneStreamTypeText"; case LinphoneStreamTypeUnknown: return "LinphoneStreamTypeUnknown"; } + return "INVALID"; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 79aeebb0e..f8fcec461 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -146,7 +146,7 @@ typedef enum _LinphoneStreamType LinphoneStreamType; * @ingroup initializing **/ -LINPHONE_PUBLIC const char *linphone_streamtype_to_string(const LinphoneStreamType); +LINPHONE_PUBLIC const char *linphone_stream_type_to_string(const LinphoneStreamType); /** * Object that represents a SIP address. * diff --git a/tester/tester.c b/tester/tester.c index 0fbc7c7c0..ad3380993 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -550,24 +550,25 @@ void liblinphone_tester_uninit(void) { } static void check_ice_from_rtp(LinphoneCall *c1, LinphoneCall *c2, LinphoneStreamType stream_type) { - MediaStream ms; + MediaStream *ms; switch (stream_type) { case LinphoneStreamTypeAudio: - ms=c1->audiostream->ms; - break; + ms=&c1->audiostream->ms; + break; case LinphoneStreamTypeVideo: - ms=c1->videostream->ms; - break; - case LinphoneStreamTypeUnknown: - ms=c1->textstream->ms; - break; - default: - ms_error("Uknown stream type [%s]", linphone_streamtype_to_string(stream_type)); - break; + ms=&c1->videostream->ms; + break; + case LinphoneStreamTypeText: + ms=&c1->textstream->ms; + break; + default: + ms_error("Unknown stream type [%s]", linphone_stream_type_to_string(stream_type)); + BC_ASSERT_FALSE(stream_type >= LinphoneStreamTypeUnknown); + return; } - if (linphone_call_get_audio_stats(c1)->ice_state == LinphoneIceStateHostConnection && media_stream_started(&ms)) { + if (linphone_call_get_audio_stats(c1)->ice_state == LinphoneIceStateHostConnection && media_stream_started(ms)) { char ip[16]; char port[8]; getnameinfo((const struct sockaddr *)&c1->audiostream->ms.sessions.rtp_session->rtp.gs.rem_addr