db.cpp : 'Load Bouquets' support for non dvb services.
[vuplus_dvbapp] / lib / service / servicemp3.cpp
index e1217b5..6aac29e 100644 (file)
@@ -229,6 +229,8 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
        m_prev_decoder_time = -1;
        m_decoder_time_valid_state = 0;
        m_errorInfo.missing_codec = "";
+       //vuplus
+       m_is_hls_stream = 0;
 
        CONNECT(m_seekTimeout->timeout, eServiceMP3::seekTimeoutCB);
        CONNECT(m_subtitle_sync_timer->timeout, eServiceMP3::pushSubtitles);
@@ -284,7 +286,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
                m_sourceinfo.containertype = ctVCD;
                m_sourceinfo.is_video = TRUE;
        }
-       if ( (strncmp(filename, "http://", 7)) == 0 || (strncmp(filename, "udp://", 6)) == 0 || (strncmp(filename, "rtp://", 6)) == 0  || (strncmp(filename, "https://", 8)) == 0 || (strncmp(filename, "mms://", 6)) == 0 || (strncmp(filename, "rtsp://", 7)) == 0 || (strncmp(filename, "rtspt://", 7)) == 0 )
+       if ( strstr(filename, "://") )
                m_sourceinfo.is_streaming = TRUE;
 
        gchar *uri;
@@ -361,6 +363,10 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
                        eDebug("eServiceMP3::subtitle uri: %s", g_filename_to_uri(srt_filename, NULL, NULL));
                        g_object_set (G_OBJECT (m_gst_playbin), "suburi", g_filename_to_uri(srt_filename, NULL, NULL), NULL);
                }
+               if ( m_sourceinfo.is_streaming )
+               {
+                       g_signal_connect (G_OBJECT (m_gst_playbin), "notify::source", G_CALLBACK (gstHTTPSourceSetAgent), this);
+               }
        } else
        {
                m_event((iPlayableService*)this, evUser+12);
@@ -690,6 +696,8 @@ 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);
 
@@ -1183,7 +1191,15 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
                case GST_MESSAGE_STATE_CHANGED:
                {
                        if(GST_MESSAGE_SRC(msg) != GST_OBJECT(m_gst_playbin))
+                       {
+                               //vuplus
+                               if(!strncmp(sourceName, "hls", 3))
+                               {
+                                       //eDebug("HLS Protocol detected : source [%s]", sourceName);
+                                       m_is_hls_stream = 1;
+                               }
                                break;
+                       }
 
                        GstState old_state, new_state;
                        gst_message_parse_state_changed(msg, &old_state, &new_state, NULL);
@@ -1462,7 +1478,13 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
                                                g_object_set (G_OBJECT (owner), "timeout", HTTP_TIMEOUT, NULL);
                                                eDebug("eServiceMP3::GST_STREAM_STATUS_TYPE_CREATE -> setting timeout on %s to %is", name, HTTP_TIMEOUT);
                                        }
-                                       
+                                       //vuplus
+                                       else if (m_is_hls_stream && !strncmp(name, "queue", 5))
+                                       {
+                                               m_streamingsrc_timeout->stop();
+                                               m_is_hls_stream = 0;
+                                               //eDebug("Stoped response timeout!! : HLS");
+                                       }
                                }
                                if ( GST_IS_PAD(source) )
                                        gst_object_unref(owner);