diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-19 10:51:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-19 10:51:34 +0300 |
commit | 6e274c986a1497315b75512ff81ef91e00cf9dd5 (patch) | |
tree | 2186fc1fb11247fda5d6854f0e57ec4f7e609679 /protocols/JabberG | |
parent | 985bb507126fda52d6c74cb5ee6a34aae9dd22fe (diff) |
code cleaning
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_voip.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_voip.cpp b/protocols/JabberG/src/jabber_voip.cpp index 37a8a80c36..5a12a22ec9 100644 --- a/protocols/JabberG/src/jabber_voip.cpp +++ b/protocols/JabberG/src/jabber_voip.cpp @@ -277,21 +277,21 @@ void dbgprint(const gchar *string) bool CJabberProto::VOIPCreatePipeline(void) { if (!m_bEnableVOIP) - return false; + goto err; //gstreamer init static bool gstinited = 0; if (!gstinited) { if (!LoadLibrary(L"gstreamer-1.0-0.dll")) { MessageBoxA(0, "Cannot load Gstreamer library!", 0, MB_OK | MB_ICONERROR); - return false; + goto err; } gst_init(NULL, NULL); g_set_print_handler(dbgprint); gst_print("preved medved"); if (!check_plugins()) { MessageBoxA(0, "Gstreamer plugins not found!", 0, MB_OK | MB_ICONERROR); - return false; + goto err; } gstinited = 1; } @@ -316,7 +316,7 @@ bool CJabberProto::VOIPCreatePipeline(void) m_webrtc1 = gst_bin_get_by_name(GST_BIN(m_pipe1), "sendrecv"); g_assert_nonnull(m_webrtc1); if (!m_webrtc1) - MessageBoxA(0, "Epic fail", "cannot create m_webrtc1", MB_OK); + goto err; GstElement *audiopay = gst_bin_get_by_name(GST_BIN(m_pipe1), "audiopay"); g_assert_nonnull(audiopay); @@ -338,14 +338,12 @@ bool CJabberProto::VOIPCreatePipeline(void) gst_object_unref(m_webrtc1); gst_print("Starting pipeline\n"); - if (gst_element_set_state(GST_ELEMENT(m_pipe1), GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) - goto err; - - return true; + if (gst_element_set_state(GST_ELEMENT(m_pipe1), GST_STATE_PLAYING) != GST_STATE_CHANGE_FAILURE) + return true; err: VOIPTerminateSession(); - return FALSE; + return false; } bool CJabberProto::VOIPTerminateSession(const char *reason) |