From: hschang Date: Wed, 13 Feb 2013 09:02:16 +0000 (+0900) Subject: servicemp3.cpp : fix crash error. X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=fd0ee85977125975fa45da6fce3f841844d2b9c3;ds=sidebyside servicemp3.cpp : fix crash error. --- diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 6aed865..69e6262 100755 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -1411,18 +1411,21 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) { if ( gst_is_missing_plugin_message(msg) ) { - GstCaps *caps; - gst_structure_get (msgstruct, "detail", GST_TYPE_CAPS, &caps, NULL); - std::string codec = (const char*) gst_caps_to_string(caps); - gchar *description = gst_missing_plugin_message_get_description(msg); - if ( description ) + GstCaps *caps= NULL; + gboolean ret = gst_structure_get (msgstruct, "detail", GST_TYPE_CAPS, &caps, NULL); + if (ret) { - eDebug("eServiceMP3::m_errorInfo.missing_codec = %s", codec.c_str()); - m_errorInfo.error_message = "GStreamer plugin " + (std::string)description + " not available!\n"; - m_errorInfo.missing_codec = codec.substr(0,(codec.find_first_of(','))); - g_free(description); + std::string codec = (const char*) gst_caps_to_string(caps); + gchar *description = gst_missing_plugin_message_get_description(msg); + if ( description ) + { + eDebug("eServiceMP3::m_errorInfo.missing_codec = %s", codec.c_str()); + m_errorInfo.error_message = "GStreamer plugin " + (std::string)description + " not available!\n"; + m_errorInfo.missing_codec = codec.substr(0,(codec.find_first_of(','))); + g_free(description); + } + gst_caps_unref(caps); } - gst_caps_unref(caps); } else {