aboutsummaryrefslogtreecommitdiff
path: root/lib/service/servicemp3.cpp
diff options
context:
space:
mode:
authorFraxinas <andreas.frisch@multimedia-labs.de>2010-07-20 10:06:11 +0200
committerFraxinas <andreas.frisch@multimedia-labs.de>2010-07-20 10:10:17 +0200
commit675f9d0eeb82577252a68ee263049acc1ff80bcc (patch)
treed8bc9830f9388ce20729fdc3f1b64c13ccaa34ed /lib/service/servicemp3.cpp
parent113a3f510100f9b8052eae3519e87dee14cc5d07 (diff)
downloadenigma2-675f9d0eeb82577252a68ee263049acc1ff80bcc.tar.gz
enigma2-675f9d0eeb82577252a68ee263049acc1ff80bcc.zip
implement configurable http user-agent (fixes #224)
Diffstat (limited to 'lib/service/servicemp3.cpp')
-rw-r--r--lib/service/servicemp3.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp
index b34b62f2..b50b52d0 100644
--- a/lib/service/servicemp3.cpp
+++ b/lib/service/servicemp3.cpp
@@ -290,8 +290,20 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
if ( m_sourceinfo.is_streaming )
{
uri = g_strdup_printf ("%s", filename);
+<<<<<<< HEAD
m_streamingsrc_timeout = eTimer::create(eApp);;
CONNECT(m_streamingsrc_timeout->timeout, eServiceMP3::sourceTimeout);
+=======
+
+ std::string config_str;
+ if( ePythonConfigQuery::getConfigValue("config.mediaplayer.useAlternateUserAgent", config_str) == 0 )
+ {
+ if ( config_str == "True" )
+ ePythonConfigQuery::getConfigValue("config.mediaplayer.alternateUserAgent", m_useragent);
+ }
+ if ( m_useragent.length() == 0 )
+ m_useragent = "Dream Multimedia Dreambox Enigma2 Mediaplayer";
+>>>>>>> b08c138... implement configurable http user-agent (fixes #224)
}
else if ( m_sourceinfo.containertype == ctCDA )
{
@@ -353,6 +365,10 @@ eServiceMP3::eServiceMP3(eServiceReference ref)
subs.language_code = std::string("und");
m_subtitleStreams.push_back(subs);
}
+ if ( sourceinfo.is_streaming )
+ {
+ g_signal_connect (G_OBJECT (m_gst_playbin), "notify::source", G_CALLBACK (gstHTTPSourceSetAgent), this);
+ }
} else
{
m_event((iPlayableService*)this, evUser+12);
@@ -1410,6 +1426,15 @@ GstBusSyncReply eServiceMP3::gstBusSyncHandler(GstBus *bus, GstMessage *message,
return GST_BUS_PASS;
}
+void eServiceMP3::gstHTTPSourceSetAgent(GObject *object, GParamSpec *unused, gpointer user_data)
+{
+ eServiceMP3 *_this = (eServiceMP3*)user_data;
+ GstElement *source;
+ g_object_get(_this->m_gst_playbin, "source", &source, NULL);
+ g_object_set (G_OBJECT (source), "user-agent", _this->m_useragent.c_str(), NULL);
+ gst_object_unref(source);
+}
+
audiotype_t eServiceMP3::gstCheckAudioPad(GstStructure* structure)
{
if (!structure)