mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
fix gst playback
This commit is contained in:
@@ -77,6 +77,35 @@ gint match_sinktype(const GValue *velement, const gchar *type)
|
||||
return strcmp(g_type_name(G_OBJECT_TYPE(element)), type);
|
||||
}
|
||||
|
||||
void playbinNotifySource(GObject *object, GParamSpec *unused, gpointer /*user_data*/)
|
||||
{
|
||||
GstElement *source = NULL;
|
||||
g_object_get(object, "source", &source, NULL);
|
||||
|
||||
if (source)
|
||||
{
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "timeout") != 0)
|
||||
{
|
||||
GstElementFactory *factory = gst_element_get_factory(source);
|
||||
if (factory)
|
||||
{
|
||||
const gchar *sourcename = gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(factory));
|
||||
if (!strcmp(sourcename, "souphttpsrc"))
|
||||
{
|
||||
g_object_set(G_OBJECT(source), "timeout", HTTP_TIMEOUT, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "ssl-strict") != 0)
|
||||
{
|
||||
g_object_set(G_OBJECT(source), "ssl-strict", FALSE, NULL);
|
||||
}
|
||||
|
||||
gst_object_unref(source);
|
||||
}
|
||||
}
|
||||
|
||||
GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
{
|
||||
gchar * sourceName;
|
||||
@@ -419,6 +448,8 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/,
|
||||
|
||||
if(isHTTP)
|
||||
{
|
||||
g_signal_connect (G_OBJECT (m_gst_playbin), "notify::source", G_CALLBACK (playbinNotifySource), NULL);
|
||||
|
||||
// set buffer size
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-size", m_buffer_size, NULL);
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-duration", 5LL * GST_SECOND, NULL);
|
||||
|
Reference in New Issue
Block a user