servicemp3.cpp : fix crash error.
[vuplus_dvbapp] / lib / service / servicemp3.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 0b85775..69e6262
@@ -47,6 +47,10 @@ eServiceFactoryMP3::eServiceFactoryMP3()
                extensions.push_back("mp4");
                extensions.push_back("mov");
                extensions.push_back("m4a");
+               extensions.push_back("flv");
+               extensions.push_back("3gp");
+               extensions.push_back("3g2");
+               extensions.push_back("dts");
                sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
        }
 
@@ -696,8 +700,6 @@ RESULT eServiceMP3::isCurrentlySeekable()
                return 0;
        if (m_state != stRunning)
                return 0;
-       if (m_sourceinfo.is_streaming)
-               return 0;
 
        g_object_get (G_OBJECT (m_gst_playbin), "video-sink", &sink, NULL);
 
@@ -1409,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
                                {